### Question:
AllPredicate extends AbstractQuantifierPredicate<T> { public boolean evaluate(final T object) { for (final Predicate<? super T> iPredicate : iPredicates) { if (!iPredicate.evaluate(object)) { return false; } } return true; } AllPredicate(final Predicate<? super T>... predicates); static Predicate<T> allPredicate(final Predicate<? super T>... predicates); static Predicate<T> allPredicate(final Collection<? extends Predicate<? super T>> predicates); boolean evaluate(final T object);  }### Answer:
@SuppressWarnings({"unchecked"}) @Test public void emptyArrayToGetInstance() { assertTrue("empty array not true", getPredicateInstance(new Predicate[] {}).evaluate(null)); }
@Test public void emptyCollectionToGetInstance() { final Predicate<Integer> allPredicate = getPredicateInstance( Collections.<Predicate<Integer>>emptyList()); assertTrue("empty collection not true", allPredicate.evaluate(getTestValue())); }
@Test public void allTrue() { assertTrue("multiple true predicates evaluated to false", getPredicateInstance(true, true).evaluate(getTestValue())); assertTrue("multiple true predicates evaluated to false", getPredicateInstance(true, true, true).evaluate(getTestValue())); }
@Test public void trueAndFalseCombined() { assertFalse("false predicate evaluated to true", getPredicateInstance(false, null).evaluate(getTestValue())); assertFalse("false predicate evaluated to true", getPredicateInstance(false, null, null).evaluate(getTestValue())); assertFalse("false predicate evaluated to true", getPredicateInstance(true, false, null).evaluate(getTestValue())); assertFalse("false predicate evaluated to true", getPredicateInstance(true, true, false).evaluate(getTestValue())); assertFalse("false predicate evaluated to true", getPredicateInstance(true, true, false, null).evaluate(getTestValue())); }