Last Updated: June 6, 2026
Collectors is a utility class in java.util.stream that supplies ready-made implementations of the Collector interface for Stream.collect. The previous lesson introduced collect(Collector) as a terminal operation; this lesson covers what you actually pass to it. We'll walk through collecting into lists, sets, and maps, grouping and partitioning, downstream collectors that summarize each group, joining strings, the teeing collector that fans a single stream into two summaries, and summary statistics that compute count, sum, min, max, and average in one pass.