BAEL-3440: Remove unnecessary sorting (#8336)
This commit is contained in:
committed by
Grzegorz Piwowarek
parent
b6ad214a34
commit
4d552daac0
@@ -24,10 +24,7 @@ public class ConvertToMap {
|
||||
|
||||
public TreeMap<String, Book> listToSortedMap(List<Book> books) {
|
||||
return books.stream()
|
||||
.sorted(Comparator.comparing(Book::getName))
|
||||
.collect(Collectors.toMap(Book::getName, Function.identity(), (o1, o2) -> o1, TreeMap::new));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user