Stream Gatherers in Java: The Stream API Finally Learned to Window, Scan, and Fold
Since Java 8, the Stream API has had an asymmetry: terminal operations were extensible — collect(Collector) lets you define any summary you like — but intermediate operations were a fixed menu. If you wanted windows, running totals, or distinct-by-key in the middle of a pipeline, …


