diff options
author | Sadaf Ebrahimi <sadafebrahimi@google.com> | 2024-01-03 17:28:59 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2024-01-03 17:28:59 +0000 |
commit | 0be00b5218b69852777cab76ff89457211904bc9 (patch) | |
tree | cbc7e4894708533a0ddc4e61da1d74e64393e0e1 /guava-testlib/src/com/google/common/collect/testing/testers/NavigableSetNavigationTester.java | |
parent | eec82bd5ace8fd2c4ba647f153c4c03e1bb41268 (diff) | |
parent | fcb68273955c94ebe12fda34018935b0c25d56dc (diff) | |
download | guava-0be00b5218b69852777cab76ff89457211904bc9.tar.gz |
Merge "Upgrade guava to v33.0.0" into main am: fcb6827395
Original change: https://android-review.googlesource.com/c/platform/external/guava/+/2894060
Change-Id: I59ee73835cab1c252c9a5e630e9b1afcd5c76417
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'guava-testlib/src/com/google/common/collect/testing/testers/NavigableSetNavigationTester.java')
-rw-r--r-- | guava-testlib/src/com/google/common/collect/testing/testers/NavigableSetNavigationTester.java | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/guava-testlib/src/com/google/common/collect/testing/testers/NavigableSetNavigationTester.java b/guava-testlib/src/com/google/common/collect/testing/testers/NavigableSetNavigationTester.java index 8b056b4cb..354dd608d 100644 --- a/guava-testlib/src/com/google/common/collect/testing/testers/NavigableSetNavigationTester.java +++ b/guava-testlib/src/com/google/common/collect/testing/testers/NavigableSetNavigationTester.java @@ -20,6 +20,7 @@ import static com.google.common.collect.testing.features.CollectionFeature.SUPPO import static com.google.common.collect.testing.features.CollectionSize.ONE; import static com.google.common.collect.testing.features.CollectionSize.SEVERAL; import static com.google.common.collect.testing.features.CollectionSize.ZERO; +import static org.junit.Assert.assertThrows; import com.google.common.annotations.GwtIncompatible; import com.google.common.collect.testing.Helpers; @@ -128,11 +129,7 @@ public class NavigableSetNavigationTester<E> extends AbstractSetTester<E> { @CollectionFeature.Require(absent = SUPPORTS_REMOVE) public void testPollFirstUnsupported() { - try { - navigableSet.pollFirst(); - fail(); - } catch (UnsupportedOperationException e) { - } + assertThrows(UnsupportedOperationException.class, () -> navigableSet.pollFirst()); } @CollectionSize.Require(SEVERAL) @@ -209,11 +206,7 @@ public class NavigableSetNavigationTester<E> extends AbstractSetTester<E> { @CollectionFeature.Require(absent = SUPPORTS_REMOVE) public void testPollLastUnsupported() { - try { - navigableSet.pollLast(); - fail(); - } catch (UnsupportedOperationException e) { - } + assertThrows(UnsupportedOperationException.class, () -> navigableSet.pollLast()); } @CollectionSize.Require(SEVERAL) |