The IdentityHashMap uses == for equality checking instead of equals(). This can be used for both performance reasons .