/** * Create a new Predicate that returns true only if both of the specified * predicates are true. * * @param <T> the type that the predicate queries * @param predicate1 the first predicate, may not be null * @param predicate2 the second predicate, may not be null * @return the <code>and</code> predicate * @throws NullPointerException if either predicate is null * @see AndPredicate */ public static <T> Predicate<T> andPredicate(final Predicate<? super T> predicate1, final Predicate<? super T> predicate2) { return AndPredicate.andPredicate(predicate1, predicate2); }