DoubleRangeUtil { public static double requireNonPositive(double val) { if (Double.compare(val, 0d) > 0) { throw new IllegalArgumentException(val + IS_POSITIVE); } return val; } private  DoubleRangeUtil(); static double requirePositive(double val); static double requireNegative(double val); static double requireZero(double val); static double requireNonPositive(double val); static double requireNonNegative(double val); static double requireNonZero(double val); static double requireEquals(double val, double otherVal); static double requireNotEquals(double val, double otherVal); static double requireInRange(double val, double first, double lastExclusive); static double requireInRangeClosed(double val, double first, double lastInclusive); static double requirePositive(double val, Function<String, E> exceptionConstructor); static double requireNegative(double val, Function<String, E> exceptionConstructor); static double requireZero(double val, Function<String, E> exceptionConstructor); static double requireNonPositive(double val, Function<String, E> exceptionConstructor); static double requireNonNegative(double val, Function<String, E> exceptionConstructor); static double requireNonZero(double val, Function<String, E> exceptionConstructor); static double requireEquals(double val, double otherVal,
                  Function<String, E> exceptionConstructor); static double requireNotEquals(double val, double otherVal,
                     Function<String, E> exceptionConstructor); static double requireInRange(double val, double first, double lastExclusive,
                   Function<String, E> exceptionConstructor); static double requireInRangeClosed(double val, double first, double lastInclusive,
                         Function<String, E> exceptionConstructor);  }
@Test void requireNonPositive() { assertEquals(-1.0, DoubleRangeUtil.requireNonPositive(-1.0)); }
@Test void requireNonPositive2() { assertThrows(IllegalArgumentException.class, () -> DoubleRangeUtil.requireNonPositive(1.0)); }
@Test void requireNonPositive3() { assertEquals(0.0, DoubleRangeUtil.requireNonPositive(0.0)); }
@Test void testRequireNonPositive() { assertEquals(-1.0, DoubleRangeUtil.requireNonPositive(-1.0, RuntimeException::new)); }
@Test void testRequireNonPositive2() { assertThrows(RuntimeException.class, () -> DoubleRangeUtil.requireNonPositive(1.0, RuntimeException::new)); }
@Test void testRequireNonPositive3() { assertEquals(0.0, DoubleRangeUtil.requireNonPositive(0.0, RuntimeException::new)); }