Is there a better way to count int occurrences with Java8
int[] monthCounter = new int[12]; persons.stream().forEach(person -> monthCounter[person.getBirt
If you would like to get Integer to Integer map, you can do the following.
Map counters = persons.stream() .collect(Collectors.groupingBy( p -> p.getBirthday().getMonthValue(), Collectors.reducing(0, e -> 1, Integer::sum)));