标签: java lambda
我想首先显示最高值,但它显示我的第一个:
songs.entrySet() .stream() .sorted(Comparator.comparing(Map.Entry::getValue)) .forEach(songs -> System.out.println(songs.getKey() + " Rate:" + songs.getValue()));