Scala: Occurrences with pairs, groupBy and map