diff --git a/android/guava-tests/test/com/google/common/collect/OrderingTest.java b/android/guava-tests/test/com/google/common/collect/OrderingTest.java index 97e9cf7dea83..311552735a1e 100644 --- a/android/guava-tests/test/com/google/common/collect/OrderingTest.java +++ b/android/guava-tests/test/com/google/common/collect/OrderingTest.java @@ -42,6 +42,7 @@ import java.util.Random; import java.util.RandomAccess; import junit.framework.TestCase; +import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -916,7 +917,7 @@ private static void testExhaustively( // shoot me, but I didn't want to deal with wildcards through the whole test @SuppressWarnings("unchecked") - Scenario starter = new Scenario<>((Ordering) ordering, list, emptyArray); + Scenario starter = new Scenario<>((Ordering) ordering, list, emptyArray); verifyScenario(starter, 0); } @@ -1000,7 +1001,8 @@ void testSortedCopy() { assertEquals(strictlyOrderedList, ordering.sortedCopy(shuffledList)); if (!strictlyOrderedList.contains(null)) { - assertEquals(strictlyOrderedList, ordering.immutableSortedCopy(shuffledList)); + List<@NonNull T> nonNullShuffledList = (List<@NonNull T>) shuffledList; + assertEquals(strictlyOrderedList, ordering.immutableSortedCopy(nonNullShuffledList)); } } } diff --git a/guava-tests/test/com/google/common/collect/OrderingTest.java b/guava-tests/test/com/google/common/collect/OrderingTest.java index 97e9cf7dea83..311552735a1e 100644 --- a/guava-tests/test/com/google/common/collect/OrderingTest.java +++ b/guava-tests/test/com/google/common/collect/OrderingTest.java @@ -42,6 +42,7 @@ import java.util.Random; import java.util.RandomAccess; import junit.framework.TestCase; +import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; /** @@ -916,7 +917,7 @@ private static void testExhaustively( // shoot me, but I didn't want to deal with wildcards through the whole test @SuppressWarnings("unchecked") - Scenario starter = new Scenario<>((Ordering) ordering, list, emptyArray); + Scenario starter = new Scenario<>((Ordering) ordering, list, emptyArray); verifyScenario(starter, 0); } @@ -1000,7 +1001,8 @@ void testSortedCopy() { assertEquals(strictlyOrderedList, ordering.sortedCopy(shuffledList)); if (!strictlyOrderedList.contains(null)) { - assertEquals(strictlyOrderedList, ordering.immutableSortedCopy(shuffledList)); + List<@NonNull T> nonNullShuffledList = (List<@NonNull T>) shuffledList; + assertEquals(strictlyOrderedList, ordering.immutableSortedCopy(nonNullShuffledList)); } } }