CodeQL library for Java
codeql/java-all 0.3.2 (changelog, source)

Member predicate Guard::isEquality

Holds if this guard is an equality test between e1 and e2. The test can be either ==, !=, .equals, or a switch case. If the test is negated, that is !=, then polarity is false, otherwise polarity is true.

predicate isEquality(Expr e1, Expr e2, boolean polarity)