News and views from members of the Java team at Oracle
Starting with the JDK 24 you can use a specific API to model your intermediate operations in the Stream API, called the Gatherers API. Design-wise it is similar to the Collector API for terminal Stream operations.