BAEL-3440: Remove unnecessary sorting (#8336)
This commit is contained in:
parent
339913ef05
commit
0201d9f0e7
|
@ -24,10 +24,7 @@ public class ConvertToMap {
|
||||||
|
|
||||||
public TreeMap<String, Book> listToSortedMap(List<Book> books) {
|
public TreeMap<String, Book> listToSortedMap(List<Book> books) {
|
||||||
return books.stream()
|
return books.stream()
|
||||||
.sorted(Comparator.comparing(Book::getName))
|
|
||||||
.collect(Collectors.toMap(Book::getName, Function.identity(), (o1, o2) -> o1, TreeMap::new));
|
.collect(Collectors.toMap(Book::getName, Function.identity(), (o1, o2) -> o1, TreeMap::new));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue