Use Collections.sort(List) for clarity

This commit is contained in:
Gary Gregory 2024-06-23 14:21:26 -04:00
parent f55d552c90
commit 5ebd823ae3
1 changed files with 3 additions and 3 deletions

View File

@ -165,7 +165,7 @@ public class FluentIterableTest {
final List<Integer> combinedList = new ArrayList<>();
CollectionUtils.addAll(combinedList, iterableOdd);
CollectionUtils.addAll(combinedList, iterableEven);
combinedList.sort(null);
Collections.sort(combinedList);
assertEquals(combinedList, result);
assertThrows(NullPointerException.class, () -> FluentIterable.of(iterableOdd).collate(null).toList(),
@ -183,7 +183,7 @@ public class FluentIterableTest {
final List<Integer> combinedList = new ArrayList<>();
CollectionUtils.addAll(combinedList, iterableOdd);
CollectionUtils.addAll(combinedList, iterableEven);
combinedList.sort(null);
Collections.sort(combinedList);
assertEquals(combinedList, result);
// null comparator is equivalent to natural ordering
@ -446,7 +446,7 @@ public class FluentIterableTest {
List<Integer> combinedList = new ArrayList<>();
CollectionUtils.addAll(combinedList, iterableOdd);
CollectionUtils.addAll(combinedList, iterableEven);
combinedList.sort(null);
Collections.sort(combinedList);
assertEquals(combinedList, result);
assertThrows(NullPointerException.class, () -> FluentIterable.of(iterableOdd).zip((Iterable<Integer>) null).toList(),