/** * Creates a Predicate that checks if the input object is equal to the * specified object by identity. * * @param <T> the type that the predicate queries * @param value the value to compare against * @return the predicate * @see IdentityPredicate */ public static <T> Predicate<T> identityPredicate(final T value) { return IdentityPredicate.identityPredicate(value); }
/** * Factory to create the identity predicate. * * @param <T> the type that the predicate queries * @param object the object to compare to * @return the predicate */ public static <T> Predicate<T> identityPredicate(final T object) { if (object == null) { return NullPredicate.<T>nullPredicate(); } return new IdentityPredicate<>(object); }