Counting using Java, map and comparators