您可以随时开始阅读文档和一些
教程。
map.entrySet().stream() .sorted(Map.Entry.<String, Integer>comparingByValue().reversed()) .limit(10) .forEach(System.out::println); // or any other terminal method
参考
http://www.leveluplunch.com/java/examples/sort-order-map-by-
values/



