Why was this omitted?
The API provides reusable building blocks. The relevant building blocks here are IntStream , mapToObj , flatMap . From this, you can achieve what you want: point the map into the stream at the objects, and then get a flat map. Providing permutations of building blocks would be impractical and more difficult to expand.
What is the recommended workaround?
As outlined earlier, use the available building blocks ( mapToObj + flatMap ):
Stream<Object> stream = IntStream.of(...) .mapToObj(i -> Stream.of(...)) .flatMap(...);
janos
source share