aboutsummaryrefslogtreecommitdiff
path: root/guava-tests/test/com/google/common/math/DoubleUtilsTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'guava-tests/test/com/google/common/math/DoubleUtilsTest.java')
-rw-r--r--guava-tests/test/com/google/common/math/DoubleUtilsTest.java7
1 files changed, 2 insertions, 5 deletions
diff --git a/guava-tests/test/com/google/common/math/DoubleUtilsTest.java b/guava-tests/test/com/google/common/math/DoubleUtilsTest.java
index 2f6263ea9..72224bc38 100644
--- a/guava-tests/test/com/google/common/math/DoubleUtilsTest.java
+++ b/guava-tests/test/com/google/common/math/DoubleUtilsTest.java
@@ -19,6 +19,7 @@ package com.google.common.math;
import static com.google.common.math.MathTesting.ALL_BIGINTEGER_CANDIDATES;
import static com.google.common.math.MathTesting.FINITE_DOUBLE_CANDIDATES;
import static com.google.common.math.MathTesting.POSITIVE_FINITE_DOUBLE_CANDIDATES;
+import static org.junit.Assert.assertThrows;
import java.lang.reflect.Method;
import java.math.BigInteger;
@@ -65,11 +66,7 @@ public class DoubleUtilsTest extends TestCase {
}
assertEquals(Double.POSITIVE_INFINITY, DoubleUtils.ensureNonNegative(Double.POSITIVE_INFINITY));
assertEquals(0.0, DoubleUtils.ensureNonNegative(Double.NEGATIVE_INFINITY));
- try {
- DoubleUtils.ensureNonNegative(Double.NaN);
- fail("Expected IllegalArgumentException from ensureNonNegative(Double.NaN)");
- } catch (IllegalArgumentException expected) {
- }
+ assertThrows(IllegalArgumentException.class, () -> DoubleUtils.ensureNonNegative(Double.NaN));
}
public void testOneBits() {