/** * Create a new Predicate that returns true if one, but not both, of the * specified predicates are true. XOR * * @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>either</code> predicate * @throws NullPointerException if either predicate is null * @see OnePredicate */ public static <T> Predicate<T> eitherPredicate(final Predicate<? super T> predicate1, final Predicate<? super T> predicate2) { @SuppressWarnings("unchecked") final Predicate<T> onePredicate = PredicateUtils.onePredicate(predicate1, predicate2); return onePredicate; }