LongRangeUtil { public static long requireNonZero(long val) { if (val == 0) { throw new IllegalArgumentException(val + IS_ZERO); } 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 RequireNonZero() { testHelper(IS_ZERO.negate(), LongRangeUtil::requireNonZero); }
@Test void testRequireNonZero() { assertEquals(1, LongRangeUtil.requireNonZero(1, RuntimeException::new)); }
@Test void testRequireNonZero2() { assertThrows(RuntimeException.class, () -> LongRangeUtil.requireNonZero(0, RuntimeException::new)); }
@Test void testRequireNonZero3() { assertEquals(-1, LongRangeUtil.requireNonZero(-1, RuntimeException::new)); }