Skip to content

Commit 2d15cb3

Browse files
committed
set benchmark tests
1 parent 23fc41d commit 2d15cb3

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎core-java-collections/src/main/java/com/baeldung/sort/SortHashMap.java‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,16 @@ public static void main(String[] args) {
1717
//arrayListSortByValue();
1818
//arrayListSortByKey();
1919

20-
treeSetByKey();
21-
treeSetByValue();
20+
//treeSetByKey();
21+
//treeSetByValue();
22+
23+
sortStream();
24+
}
25+
26+
private static void sortStream() {
27+
map.entrySet().stream()
28+
.sorted(Map.Entry.<String, Employee>comparingByKey().reversed())
29+
.forEach(System.out::println);
2230
}
2331

2432
private static void treeSetByValue() {

0 commit comments

Comments
 (0)