DoubleRangeUtil { public static double requireInRange(double val, double first, double lastExclusive) { if (val < first || val >= lastExclusive) { throw new IllegalArgumentException(val + IS_NOT_IN_THE_RANGE + first + ", " + lastExclusive + ")"); } 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 requireInRange() { assertEquals(0.0, DoubleRangeUtil.requireInRange(0.0, -1.0,1.0)); }
@Test void requireInRange2() { assertThrows(IllegalArgumentException.class, () -> DoubleRangeUtil.requireInRange(-1.0,0.0,1.0)); }
@Test void requireInRange3() { assertThrows(IllegalArgumentException.class, () -> DoubleRangeUtil.requireInRange(1.0,-1.0,0.0)); }
@Test void requireInRange4() { assertThrows(IllegalArgumentException.class, () -> DoubleRangeUtil.requireInRange(0.0,-1.0,0.0)); }
@Test void testRequireInRange() { assertEquals(0.0, DoubleRangeUtil.requireInRange(0.0, -1.0,1.0, RuntimeException::new)); }
@Test void testRequireInRange2() { assertThrows(RuntimeException.class, () -> DoubleRangeUtil.requireInRange(-1.0,0.0,1.0, RuntimeException::new)); }
@Test void testRequireInRange3() { assertThrows(RuntimeException.class, () -> DoubleRangeUtil.requireInRange(1.0,-1.0,0.0, RuntimeException::new)); }
@Test void testRequireInRange4() { assertThrows(RuntimeException.class, () -> DoubleRangeUtil.requireInRange(0.0,-1.0,0.0, RuntimeException::new)); }