I write a lot of Java, and really, almost everything since Java 8 should not have been added. Lambdas, for example, are a kludge in Java.
Want modern features? Use a modern language. If you want to stay in the Java ecosystem, for example, you could use Kotlin.
I'm talking about Java only because I haven't seen Pascal for literally decades. I last programmed Pascal in the 1980s. Adding that laundry list of features to Pascal is just silly.