### Question:
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);  }### Answer:
@Test public void testValidateArgTrueCondition() { ParamUtils.validate(true, () -> "Should not throw"); }
@Test public void testValidateArgFalseCondition() { final String message = "thrown"; try { ParamUtils.validate(false, () -> message); Assert.fail(); } catch (final IllegalArgumentException e) { Assert.assertEquals(e.getMessage(), message); } }