LongRangeUtil { public static long requireNonNegative(long val) { if (val < 0) { throw new IllegalArgumentException(val + IS_NEGATIVE); } return val; } private  LongRangeUtil(); static long requirePositive(long val); static long requireNegative(long val); static long requireZero(long val); static long requireNonPositive(long val); static long requireNonNegative(long val); static long requireNonZero(long val); static long requireEquals(long val, long otherVal); static long requireNotEquals(long val, long otherVal); static long requireInRange(long val, long first, long lastExclusive); static long requireInRangeClosed(long val, long first, long lastInclusive); static long requirePositive(long val, Function<String, E> exceptionConstructor); static long requireNegative(long val, Function<String, E> exceptionConstructor); static long requireZero(long val, Function<String, E> exceptionConstructor); static long requireNonPositive(long val, Function<String, E> exceptionConstructor); static long requireNonNegative(long val, Function<String, E> exceptionConstructor); static long requireNonZero(long val, Function<String, E> exceptionConstructor); static long requireEquals(long val, long otherVal, Function<String, E> exceptionConstructor); static long requireNotEquals(long val, long otherVal, Function<String, E> exceptionConstructor); static long requireInRange(long val, long first, long lastExclusive, Function<String, E> exceptionConstructor); static long requireInRangeClosed(long val, long first, long lastInclusive, Function<String, E> exceptionConstructor);  }
@Test void RequireNonNegative() { testHelper(IS_NEGATIVE.negate(), LongRangeUtil::requireNonNegative); }
@Test void testRequireNonNegative() { assertEquals(1, LongRangeUtil.requireNonNegative(1, RuntimeException::new)); }
@Test void testRequireNonNegative2() { assertThrows(RuntimeException.class, () -> LongRangeUtil.requireNonNegative(-1, RuntimeException::new)); }
@Test void testRequireNonNegative3() { assertEquals(0.0, LongRangeUtil.requireNonNegative(0, RuntimeException::new)); }