mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-06-18 23:11:44 +07:00
a5474b0313
GitOrigin-RevId: a273d8198f8a19921a4075ed93c81fd84a8bee63
14 lines
439 B
Java
14 lines
439 B
Java
// "Replace with 'Entry.comparingByKey()'" "true"
|
|
|
|
import java.util.Comparator;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.stream.Collectors;
|
|
|
|
class X {
|
|
private static List<Map.Entry<String, Integer>> sortFrequencies(Map<String, Integer> freq) {
|
|
return freq.entrySet().stream()
|
|
.sorted(Map.Entry.<String, Integer>comparingByKey().thenComparing(Map.Entry::getValue))
|
|
.collect(Collectors.toList());
|
|
}
|
|
} |