Grouping numbers

Report a typo

Given a stream with the groupingBy collector.

??? numbers = Stream.of(1, 2, 1, 3, 2, 4).collect(Collectors.groupingBy(Function.identity()));

The identity function is equal to x -> x.

The result is a Map. What elements does the map contain?

Note, {} is the brackets for a map, [] is the brackets for a list.

Select one option from the list
___

Create a free account to access the full topic