In Java, the java.util.stream.Collectors class provides a number of useful methods for performing reductions on streams. Here are some commonly used ones:
toList(): Collects all Stream elements into a List instance.
toSet(): Collects all Stream elements into a Set instance.
toMap(): Creates a Map instance from the Stream elements, with the first function serving as the map’s keys and the second function as the values.
joining(): Concatenates all Stream elements into a String.
counting(): Counts the number of elements in the Stream.
summingInt(), summingLong(), summingDouble(): Sums the Stream elements.
maxBy(), minBy(): Finds the maximum or minimum Stream element according to a provided Comparator.
collectingAndThen(): Performs an additional finishing transformation.
partitioningBy(): Partitions the Stream elements into a Map according to a Predicate.
These are just a few examples. The Collectors class provides many more utility methods for common tasks.