...
This code uses ==
to compare two Integer
objects. According to guideline EXP01-J. Avoid comparing objects using Do not confuse abstract object equality with reference equality operators, for ==
to return true
for two object references, they must point to the same underlying object. Results of using the ==
operator in this case will be misleading.
...