Count products as they are scanned
countBy
groupingBy and eachCount
array_count_values
collections.Counter
Map.updated and getOrElse