Answer the question
In order to leave comments, you need to log in
Why doesn't StreamApi sorting work?
Good afternoon !
Sorting not working
List<String> expectedOrderedByAscList = actualOrderedByAscList
.stream()
.sorted(Comparator.naturalOrder())
.collect(Collectors.toList());
List<String> expectedOrderedByAscList = actualOrderedByAscList
.stream()
.sorted((String s1,String s2)->{ return s1.compareTo(s2);})
.collect(Collectors.toList());
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question