Given the following as an example of data classes:
class Country {
List regions = new ArrayList<>();
List getRegi
A technical reason, which is not ideal but could be why this wasn't done. You can't overload on a generic type in Java.
They need to support
Stream.flatMap(Function
which means they can't overload it with
Stream.flatMap(Function
as these two methods have the same signature after erasure.
They could add a method
Stream.flatMapCollection(Function
or
Stream.flatMapIterable(Function
but it wouldn't be pretty.