Predefined collector function is to trap those factory method (such as grouping By) can be provided from Collectors class created.
They are mainly provides three functions:
• The flow reduction elements and a summary value
• grouping of elements
• partition element
• collect operation is a terminal that accepts flow parameter is accumulated in the summary results of the various elements (referred as the collector).
• Predefined collector comprises flow reduction element and aggregated to a value, for example, calculating the minimum, maximum or average value.
• Predefined collector may be grouped with groupingBy convection elements or partition with partitioningBy.
• collector can efficiently compounded, multi-level packet, partition and reduction.
• Collector methods defined in the interface you can implement to develop your own collector.
Source: java8 combat Chapter 6