@Test void checkNotNegativeNumberNegative() { Assertions.assertThatThrownBy(() -> Arguments.checkNotNegativeNumber(-12L, "property")) .isInstanceOf(IllegalArgumentException.class) .hasMessage("Expecting a positive or zero number for property"); }
public static void checkNotNegativeNumber(final Number number, final String name) throws IllegalArgumentException { if (number == null || number.doubleValue() < 0) { throw new IllegalArgumentException("Expecting a positive or zero number for " + name); } }
Arguments { public static void checkNotNegativeNumber(final Number number, final String name) throws IllegalArgumentException { if (number == null || number.doubleValue() < 0) { throw new IllegalArgumentException("Expecting a positive or zero number for " + name); } } }
Arguments { public static void checkNotNegativeNumber(final Number number, final String name) throws IllegalArgumentException { if (number == null || number.doubleValue() < 0) { throw new IllegalArgumentException("Expecting a positive or zero number for " + name); } } private  Arguments(); }
Arguments { public static void checkNotNegativeNumber(final Number number, final String name) throws IllegalArgumentException { if (number == null || number.doubleValue() < 0) { throw new IllegalArgumentException("Expecting a positive or zero number for " + name); } } private  Arguments(); static String checkNonEmpty(final String string, final String name); static String checkOneCharString(final String string, final String name); static String checkDuration(final String string, final String name); static String checkDurationNotRequired(final String string, final String name); static void checkPositiveNumber(final Number number, final String name); static void checkNotNegativeNumber(final Number number, final String name); static void checkNotNull(final Object obj, final String name); static void checkPrecision(@Nullable final ChronoUnit precision); }
Arguments { public static void checkNotNegativeNumber(final Number number, final String name) throws IllegalArgumentException { if (number == null || number.doubleValue() < 0) { throw new IllegalArgumentException("Expecting a positive or zero number for " + name); } } private  Arguments(); static String checkNonEmpty(final String string, final String name); static String checkOneCharString(final String string, final String name); static String checkDuration(final String string, final String name); static String checkDurationNotRequired(final String string, final String name); static void checkPositiveNumber(final Number number, final String name); static void checkNotNegativeNumber(final Number number, final String name); static void checkNotNull(final Object obj, final String name); static void checkPrecision(@Nullable final ChronoUnit precision);  }