{ HashMap<String, Integer> hashMap = new HashMap<>(); hashMap.put("Alice", 30); hashMap.put("Bob", 20); hashMap.put("Charlie", 25); List<Map.Entry<String, Integer>> list = new ArrayList<>(hashMap.entrySet()); // 使用Comparator对List进行排序 Collections.sort(list, new Comparat...