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<Object, Stream<X>> function)
which means they can't overload it with
Stream.flatMap(Function<Object, Collection<X>> function)
as these two methods have the same signature after erasure.
They could add a method
Stream.flatMapCollection(Function<Object, Collection<X>> function)
or
Stream.flatMapIterable(Function<Object, Iterable<X>> function)
Stream.flatMapI(Function<Object, Iterable<X>> function)
but it wouldn't be pretty.