PredicateIncompatibleType
Using ::equals or ::isInstance as an incompatible Predicate; the predicate will always return false

Severity
ERROR
Has Fix?
NO_FIX

The problem

Using Foo::equals as a Predicate for any type that is not compatible with Foo is almost certainly a bug, since the predicate will always return false.

For example, consider:

Predicate<Integer> p = "hello"::equals;

See also EqualsIncompatibleType.

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("PredicateIncompatibleType") to the enclosing element.