LongRangeUtil { public static long requireEquals(long val, long otherVal) { if (val != otherVal) { throw new IllegalArgumentException(val + IS_NOT_EQUAL_TO + otherVal); } 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 RequireEquals() { final long otherVal = 3; testHelper(l -> l == otherVal, l -> LongRangeUtil.requireEquals(l, otherVal)); }
@Test void testRequireEquals() { assertEquals(0, LongRangeUtil.requireEquals(0, 0, RuntimeException::new)); }
@Test void testRequireEquals2() { assertThrows(RuntimeException.class, () -> LongRangeUtil.requireEquals(0,-1, RuntimeException::new)); }
@Test void testRequireEquals3() { assertThrows(RuntimeException.class, () -> LongRangeUtil.requireEquals(0,1, RuntimeException::new)); }
@Test void testRequireEquals4() { assertEquals(1.0, LongRangeUtil.requireEquals(1, 1, RuntimeException::new)); }
@Test void testRequireEquals5() { assertThrows(RuntimeException.class, () -> LongRangeUtil.requireEquals(1,0, RuntimeException::new)); }
@Test void testRequireEquals6() { assertThrows(RuntimeException.class, () -> LongRangeUtil.requireEquals(1,-1, RuntimeException::new)); }
@Test void testRequireEquals7() { assertEquals(-1.0, LongRangeUtil.requireEquals(-1, -1, RuntimeException::new)); }
@Test void testRequireEquals8() { assertThrows(RuntimeException.class, () -> LongRangeUtil.requireEquals(-1,0, RuntimeException::new)); }
@Test void testRequireEquals9() { assertThrows(RuntimeException.class, () -> LongRangeUtil.requireEquals(-1,1, RuntimeException::new)); }