The Stream.flatMap() operation transforms a stream of
Stream.flatMap()
a, b, c
into a stream that contains zero or more elements for each input el
You can hack your way around. See the following example:
Stream> stream = Stream.of("Cat", "Dog", "Whale", "Mouse") .collect(Collectors.collectingAndThen( Collectors.partitioningBy(a -> a.length() > 3), map -> Stream.of(map.get(true), map.get(false)) ));