List<Map.Entry<TbDiseases, Double>> list = new ArrayList<Map.Entry<TbDiseases,Double>>(disMap.entrySet()); Collections.sort(list, new Comparator<Map.Entry<TbDiseases, Double>>() { @Override public int compare(Entry<TbDiseases, Double> o1, Entry<TbDiseases, Double> o2) { return o2.getValue().compareTo(o1.getValue()); } });