stuff like this always makes me miss Ruby's even-shorter-hand version though :)

  groceriesByDepartment.mapValues(&:count)  # not ruby, but meh