https://wenku.baidu.com/view/103ff6733f1ec5da50e2524de518964bcf84d20a.html
private static void sortMapValue() {
Map<String,String> map =new HashMap<>();
map.put("a","2");
map.put("c","5");
map.put("d","6");
map.put("b","1");
List<Map.Entry<String,String>> lstEntry=new ArrayList<>(map.entrySet());
Collections.sort(lstEntry,((o1, o2)->{
return o1.getValue().compareTo(o2.getValue());
}));
lstEntry.forEach(o->{
System.out.println(o.getKey()+":"+o.getValue());
});
//如果⼀定要返回⼀个map,就new⼀个LinkedHashMap,将list中所有值依次put进去就可以
/*
LinkedHashMap<String,String> linkedHashMap=new LinkedHashMap<>();
lstEntry.forEach(o->{
linkedHashMap.put(o.getKey(),o.getValue());
});
*/
}