OptionalEquality
Comparison using reference equality instead of value equality

Category
Severity
ERROR
Maturity

The problem

Optionals should be compared for value equality using .equals(), and not for reference equality using == and !=.

Suppression

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