@Test public void testValidateArgFalseCondition() { final String message = "thrown"; try { ParamUtils.validate(false, () -> message); Assert.fail(); } catch (final IllegalArgumentException e) { Assert.assertEquals(e.getMessage(), message); } }
public static void validate(final boolean condition, final Supplier<String> message) { if (!condition) { throw new IllegalArgumentException(message.get()); } }
ParamUtils { public static void validate(final boolean condition, final Supplier<String> message) { if (!condition) { throw new IllegalArgumentException(message.get()); } } }
ParamUtils { public static void validate(final boolean condition, final Supplier<String> message) { if (!condition) { throw new IllegalArgumentException(message.get()); } } private  ParamUtils(); }
ParamUtils { public static void validate(final boolean condition, final Supplier<String> message) { if (!condition) { throw new IllegalArgumentException(message.get()); } } private  ParamUtils(); static void validate(final boolean condition, final Supplier<String> message); static int validateIndex(final int index, final int length); static T nonNull(final T object, final Supplier<String> message); static T nonNull(final T object); static T nonEmpty(final T collection, final Supplier<String> message); static T nonEmpty(final T collection); }
ParamUtils { public static void validate(final boolean condition, final Supplier<String> message) { if (!condition) { throw new IllegalArgumentException(message.get()); } } private  ParamUtils(); static void validate(final boolean condition, final Supplier<String> message); static int validateIndex(final int index, final int length); static T nonNull(final T object, final Supplier<String> message); static T nonNull(final T object); static T nonEmpty(final T collection, final Supplier<String> message); static T nonEmpty(final T collection);  }