...

/

Grouping and Partitioning

Grouping and Partitioning

Learn about the `groupingBy` and `partitioningBy` method.

We'll cover the following...

Introduction to grouping and partitioning

The groupingBy collector groups elements based on a function we provide. For example:

List<Dragon> dragons = getDragons();
Map<Character,List<Dragon>> map = dragons.stream()
       
...