Map<String, Long> counts = list.stream().collect(Collectors.groupingBy(e -> e, Collectors.counting()));