ArrayList<Entry<Integer,Integer>> infoIds = new ArrayList<Entry<Integer,Integer>>(hashCount.entrySet());
Collections.sort(infoIds, new Comparator<Map.Entry<Integer, Integer>>() {
public int compare(Map.Entry<Integer, Integer> o1, Map.Entry<Integer, Integer> o2) {
return (o2.getValue() - o1.getValue());
}
});