Conditions { public static boolean notEmptyOrNullFilled(List value) { return notEmptyOrNullFilled(value, "argument"); } Conditions(); static UnsupportedOperationException unimplemented(); static boolean notNull(Object value); static boolean notNull(Object value, String name); static boolean notEmptyOrNullFilled(List value); static boolean notEmptyOrNullFilled(List value, String name);  }
@Test void notEmptyOrNullFilled() { assertThrows(IllegalArgumentException.class, () -> Conditions.notEmptyOrNullFilled(null)); assertThrows(IllegalArgumentException.class, () -> Conditions.notEmptyOrNullFilled(null, "arg")); assertThrows(IllegalArgumentException.class, () -> Conditions.notEmptyOrNullFilled(new ArrayList())); assertThrows(IllegalArgumentException.class, () -> Conditions.notEmptyOrNullFilled(new ArrayList(), "arg")); List<Object> nullList = new ArrayList<>(); for (int i = 0; i < 10; i++) { nullList.add(null); } assertThrows(IllegalArgumentException.class, () -> Conditions.notEmptyOrNullFilled(nullList)); assertThrows(IllegalArgumentException.class, () -> Conditions.notEmptyOrNullFilled(nullList, "arg")); List<Object> filledList = new ArrayList<>(); for (int i = 0; i < 10; i++) { filledList.add(new Object()); } assertTrue(Conditions.notEmptyOrNullFilled(filledList)); assertTrue(Conditions.notEmptyOrNullFilled(filledList, "mystring")); }