Update Checks_checkAll.java
@@ -30,11 +30,13 @@ public class Checks_checkAll {
Checks.checkAll((Object[]) null, x -> true, "test");
}
+
@Test(expected = IllegalArgumentException.class)
public void mustBeGivenACollection() {
Checks.checkAll((Collection<?>) null, x -> true, "test");
}
+
@Test(expected = IllegalArgumentException.class)
public void mustBeGivenAPredicate() {
Checks.checkAll(new String[]{}, null, "test");
@@ -46,6 +48,7 @@ public class Checks_checkAll {
Checks.checkAll(new Integer[]{1, 3, 5}, x -> (x.intValue() % 2) == 1, "test");
}
+
@Test(expected = IllegalArgumentException.class)
public void throwsIfPredicateIsFalseForAny() {
Checks.checkAll(new Integer[]{1, 4, 5}, x -> (x.intValue() % 2) == 1, "test");
