Assert { public static void notEmpty(Collection<?> collection, String message) { if (null == collection || collection.isEmpty()) { throw new IllegalArgumentException("Collection argument cannot be empty"); } } private  Assert(); static void notEmpty(Collection<?> collection, String message); static void isTrue(boolean expression, String message); static void hasText(String text, String message); static void notNull(Object object, String message);  }
@Test void testNotEmpty() { Collection<String> collection = new ArrayList<>(); collection.add("foo"); gov.nyc.doitt.gis.geoclient.parser.util.Assert.notEmpty(collection, "bar"); }
@Test void testNotEmpty_null() { Collection<String> collection = null; assertThrows(IllegalArgumentException.class, () -> gov.nyc.doitt.gis.geoclient.parser.util.Assert.notEmpty(collection, "bar"), "bar"); }
@Test void testNotEmpty_empty() { Collection<String> collection = new ArrayList<>(); assertThrows(IllegalArgumentException.class, () -> gov.nyc.doitt.gis.geoclient.parser.util.Assert.notEmpty(collection, "bar"), "bar"); }