Integer countSum = 0;
for (int i = 0; i < reader.getTagCounts().size(); i++) {
countMap.put(i, reader.getTagCounts().get(i));
countSum += reader.getTagCounts().get(i);
}
<BUG>Map<Integer, Integer> sortedCountMap = new TreeMap<Integer, Integer>(

new IntMapComparator(countMap));</BUG>
sortedCountMap.putAll(countMap);
for (Map.Entry<Integer, Integer> entry : sortedCountMap.entrySet()) {

Integer countSum = 0;
for (int i = 0; i < reader.getTagCounts().size(); i++) {
countMap.put(i, reader.getTagCounts().get(i));
countSum += reader.getTagCounts().get(i);
}
Map<Integer, Integer> sortedCountMap = new TreeMap<Integer, Integer>(new IntMapComparator(countMap));
sortedCountMap.putAll(countMap);
for (Map.Entry<Integer, Integer> entry : sortedCountMap.entrySet()) {
