Count records by an extracted key
Map.merge
groupingBy and eachCount
array_count_values
collections.Counter