@Test(dataProvider = "emptyOrNullCollections") public void testNonEmptyCollection(final Collection<?> collection, final String message) { try { ParamUtils.nonEmpty(collection, () -> message); Assert.fail(); } catch (final IllegalArgumentException e) { Assert.assertEquals(e.getMessage(), message); } }
public static <T extends Collection<?>> T nonEmpty(final T collection, final Supplier<String> message) { if (!nonNull(collection, message).isEmpty()) { return collection; } throw new IllegalArgumentException(message.get()); }
ParamUtils { public static <T extends Collection<?>> T nonEmpty(final T collection, final Supplier<String> message) { if (!nonNull(collection, message).isEmpty()) { return collection; } throw new IllegalArgumentException(message.get()); } }
ParamUtils { public static <T extends Collection<?>> T nonEmpty(final T collection, final Supplier<String> message) { if (!nonNull(collection, message).isEmpty()) { return collection; } throw new IllegalArgumentException(message.get()); } private  ParamUtils(); }
ParamUtils { public static <T extends Collection<?>> T nonEmpty(final T collection, final Supplier<String> message) { if (!nonNull(collection, message).isEmpty()) { return collection; } 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 <T extends Collection<?>> T nonEmpty(final T collection, final Supplier<String> message) { if (!nonNull(collection, message).isEmpty()) { return collection; } 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);  }