Answer
Collectors accumulate stream elements into collections or other results.
Examples: toList(), toSet(), groupingBy(), joining().
Useful for aggregation and transformation.
Examples: toList(), toSet(), groupingBy(), joining().
Useful for aggregation and transformation.