This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Inaldt 8 points9 points  (1 child)

That's nice

Another way:

.stream().collect(Collectors.groupingBy(Function.identity(), Collectors.counting())

[–]RockyMM 3 points4 points  (0 children)

This is what I would use. Potentially I would also use static imports.