23. Map에서 키/값 모두 이용하여 정렬하기
// 키/값 모두 이용하여 오름차순 정렬하기 List entryList = new ArrayList(map.entrySet()); entryList.sort(Map.Entry.comparingByKey().thenComparing(Map.Entry.comparingByValue())); Map sortedMap = new LinkedHashMap(); for (Map.Entry entry : entryList) { sortedMap.put(entry.getKey(), entry.getValue()); }