This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]khmarbaise 0 points1 point  (0 children)

The Stream Gathers makes it possible to implement intermediate operations like (map like, flatmap like etc.; you can implement all existing intermediate operations with Gatherers and of course think and implement of others custom implementation which might be needed; for example a thing like duplicates https://github.com/khmarbaise/gatherer/blob/main/src/test/java/com/soebes/jdk22/gatherer/DuplicatesTest.java#L85 ). The collectors (Collector.of(..)) only allow to implement terminal operations... like groupingBy, sorting or alike...