@Test public void checkLessThanOrEqualMustPassIfArgumentIsLessThanExpected() { final int n = 0; final int actual = RangeUtil.checkLessThanOrEqual(n, 1, "var"); assertThat(actual, is(equalTo(n))); }
public static int checkLessThanOrEqual(int n, long expected, String name) { if (n > expected) { throw new IllegalArgumentException(name + ": " + n + " (expected: <= " + expected + ')'); } return n; }
RangeUtil { public static int checkLessThanOrEqual(int n, long expected, String name) { if (n > expected) { throw new IllegalArgumentException(name + ": " + n + " (expected: <= " + expected + ')'); } return n; } }
RangeUtil { public static int checkLessThanOrEqual(int n, long expected, String name) { if (n > expected) { throw new IllegalArgumentException(name + ": " + n + " (expected: <= " + expected + ')'); } return n; }  }
RangeUtil { public static int checkLessThanOrEqual(int n, long expected, String name) { if (n > expected) { throw new IllegalArgumentException(name + ": " + n + " (expected: <= " + expected + ')'); } return n; }  static long checkPositive(long n, String name); static int checkPositiveOrZero(int n, String name); static int checkLessThan(int n, int expected, String name); static int checkLessThanOrEqual(int n, long expected, String name); static int checkGreaterThanOrEqual(int n, int expected, String name); }
RangeUtil { public static int checkLessThanOrEqual(int n, long expected, String name) { if (n > expected) { throw new IllegalArgumentException(name + ": " + n + " (expected: <= " + expected + ')'); } return n; }  static long checkPositive(long n, String name); static int checkPositiveOrZero(int n, String name); static int checkLessThan(int n, int expected, String name); static int checkLessThanOrEqual(int n, long expected, String name); static int checkGreaterThanOrEqual(int n, int expected, String name);  }