...
When canonicalization of objects is required, it may be wiser to use a custom canonicalizer built on top of ConcurrentHashMap; see Bloch asdf for [Bloch 2008] Item 69 for details.
Applicability
Using reference equality to compare objects can lead to unexpected results.
...