@Test void testAssertPositiveLong() { assertPositive(0L, "Zero is positive"); assertPositive(1L, "One is also positive"); testAssertFails(() -> assertPositive(-1L, "Minus one is not positive"), "BuilderUtils.assertPositive() should have failed on value -1."); Random random = new Random(); for (int i = 0; i < NUMBER_OF_RANDOM_NUMBERS; i++) { long value = random.nextLong(); if (value >= 0L) { assertPositive(value, "Value " + value + " is positive."); } else { testAssertFails(() -> assertPositive(value, "fail"), "Value " + value + " is negative."); } } }
public static void assertPositive(int i, String exceptionMessage) { assertThat(i, number -> number >= 0, exceptionMessage); }
BuilderUtils { public static void assertPositive(int i, String exceptionMessage) { assertThat(i, number -> number >= 0, exceptionMessage); } }
BuilderUtils { public static void assertPositive(int i, String exceptionMessage) { assertThat(i, number -> number >= 0, exceptionMessage); } private  BuilderUtils(); }
BuilderUtils { public static void assertPositive(int i, String exceptionMessage) { assertThat(i, number -> number >= 0, exceptionMessage); } private  BuilderUtils(); static void assertThat(T value,
                                      Predicate<T> assertion,
                                      String exceptionMessage); static void assertNonNull(T value, String exceptionMessage); static void assertPositive(int i, String exceptionMessage); static void assertPositive(long l, String exceptionMessage); static void assertStrictPositive(int i, String exceptionMessage); static void assertStrictPositive(long l, String exceptionMessage); static void assertNonEmpty(String string, String exceptionMessage); }
BuilderUtils { public static void assertPositive(int i, String exceptionMessage) { assertThat(i, number -> number >= 0, exceptionMessage); } private  BuilderUtils(); static void assertThat(T value,
                                      Predicate<T> assertion,
                                      String exceptionMessage); static void assertNonNull(T value, String exceptionMessage); static void assertPositive(int i, String exceptionMessage); static void assertPositive(long l, String exceptionMessage); static void assertStrictPositive(int i, String exceptionMessage); static void assertStrictPositive(long l, String exceptionMessage); static void assertNonEmpty(String string, String exceptionMessage);  }