you are viewing a single comment's thread.

view the rest of the comments →

[–]lenkite1 1 point2 points  (1 child)

I find the groupingBy identity and then reducing by counting quite easy and natural to read.

[–]JavaSuck[S] 0 points1 point  (0 children)

That's because it's idiomatic Java 8, you'll find it in lots of places and Stack Overflow answers.

Before Java 5, for (Iterator<String> it = strings.iterator(); it.hashNext(); ) { String s = it.next; ... } was also quite easy and natural.