### Question:
SortUtils { public static List<String> sortedToMap(HashMap<Long, Integer> temp, int N) { List<Map.Entry<Long, Integer>> resulttemp = new ArrayList<>(temp.entrySet()); Collections.sort(resulttemp, new Comparator<Map.Entry<Long, Integer>>() { @Override public int compare(Map.Entry<Long, Integer> o1, Map.Entry<Long, Integer> o2) { return (o2.getValue() - o1.getValue()); } }); List<String> sortedtemp = new ArrayList<String>(); for (int k = 0; k < Math.min(temp.size(), N); k++) { sortedtemp.add(resulttemp.get(k).toString()); } 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 testSortedToMap() { List<String> result = SortUtils.sortedToMap(hs3, 2); assertEquals("[2=33, 1=22]", result.toString()); }