### Question:
SortUtils { public static List<HashMap<String, Integer>> sortedToDoubleMap(HashMap<Integer, Integer> temp, String keyname1, String keyname2, int num) { List<Map.Entry<Integer, Integer>> resulttemp = new ArrayList<>(temp.entrySet()); Collections.sort(resulttemp, new Comparator<Map.Entry<Integer, Integer>>() { @Override public int compare(Map.Entry<Integer, Integer> o1, Map.Entry<Integer, Integer> o2) { return (o2.getValue() - o1.getValue()); } }); List<HashMap<String, Integer>> sortedtemp = new ArrayList<>(); String info, key, value; for (int k = 0; k < Math.min(num, temp.size()); k++) { HashMap<String, Integer> t = new HashMap<>(); info = resulttemp.get(k).toString(); key = info.substring(0, info.indexOf("=")); value = info.substring(info.indexOf("=") + 1); t.put(keyname1, Integer.parseInt(key)); t.put(keyname2, Integer.parseInt(value)); sortedtemp.add(t); } return sortedtemp; }  static String sortedToString(HashMap<String,Integer> temp); static String[] sortedToStrings(HashMap<String,Integer> temp); static List<String> sortedToHashMap(HashMap<String, Integer> temp); static List<String> sortedToMap(HashMap<Long, Integer> temp, int N); static HashMap<Long, Integer> sortedToList(HashMap<Long, Integer> temp, int N); static List<HashMap<String, Integer>> sortedToDoubleMap(HashMap<Integer, Integer> temp, String keyname1,
			String keyname2, int num); static List<List<HashMap<String, String>>> getTop10PeerHour(int[][] temp24h,
			HashMap<Integer, String> contentTypes);  }### Answer:
@Test public void testSortedToDoubleMap() { assertEquals("[{value=33, key=2}, {value=22, key=1}, {value=11, key=3}]", SortUtils.sortedToDoubleMap(hs2, "key", "value", 3).toString()); }