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

Category
Severity
ERROR
Maturity

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 an @SuppressWarnings("PredicateIncompatibleType") annotation to the enclosing element.