Use Collections.sort(List) for clarity
This commit is contained in:
parent
f55d552c90
commit
5ebd823ae3
|
@ -165,7 +165,7 @@ public class FluentIterableTest {
|
||||||
final List<Integer> combinedList = new ArrayList<>();
|
final List<Integer> combinedList = new ArrayList<>();
|
||||||
CollectionUtils.addAll(combinedList, iterableOdd);
|
CollectionUtils.addAll(combinedList, iterableOdd);
|
||||||
CollectionUtils.addAll(combinedList, iterableEven);
|
CollectionUtils.addAll(combinedList, iterableEven);
|
||||||
combinedList.sort(null);
|
Collections.sort(combinedList);
|
||||||
assertEquals(combinedList, result);
|
assertEquals(combinedList, result);
|
||||||
|
|
||||||
assertThrows(NullPointerException.class, () -> FluentIterable.of(iterableOdd).collate(null).toList(),
|
assertThrows(NullPointerException.class, () -> FluentIterable.of(iterableOdd).collate(null).toList(),
|
||||||
|
@ -183,7 +183,7 @@ public class FluentIterableTest {
|
||||||
final List<Integer> combinedList = new ArrayList<>();
|
final List<Integer> combinedList = new ArrayList<>();
|
||||||
CollectionUtils.addAll(combinedList, iterableOdd);
|
CollectionUtils.addAll(combinedList, iterableOdd);
|
||||||
CollectionUtils.addAll(combinedList, iterableEven);
|
CollectionUtils.addAll(combinedList, iterableEven);
|
||||||
combinedList.sort(null);
|
Collections.sort(combinedList);
|
||||||
assertEquals(combinedList, result);
|
assertEquals(combinedList, result);
|
||||||
|
|
||||||
// null comparator is equivalent to natural ordering
|
// null comparator is equivalent to natural ordering
|
||||||
|
@ -446,7 +446,7 @@ public class FluentIterableTest {
|
||||||
List<Integer> combinedList = new ArrayList<>();
|
List<Integer> combinedList = new ArrayList<>();
|
||||||
CollectionUtils.addAll(combinedList, iterableOdd);
|
CollectionUtils.addAll(combinedList, iterableOdd);
|
||||||
CollectionUtils.addAll(combinedList, iterableEven);
|
CollectionUtils.addAll(combinedList, iterableEven);
|
||||||
combinedList.sort(null);
|
Collections.sort(combinedList);
|
||||||
assertEquals(combinedList, result);
|
assertEquals(combinedList, result);
|
||||||
|
|
||||||
assertThrows(NullPointerException.class, () -> FluentIterable.of(iterableOdd).zip((Iterable<Integer>) null).toList(),
|
assertThrows(NullPointerException.class, () -> FluentIterable.of(iterableOdd).zip((Iterable<Integer>) null).toList(),
|
||||||
|
|
Loading…
Reference in New Issue