IndentityHashMap in Java implements Map interface. But it is not a
general purpose implementation. It violates the general contract of
Map interface by a different implementation of equals() method.
In an IdentityHashMap, two keys k1 and k2 are equal if and only if
(k1==k2). (In a normal Map implementation (like HashMap) two
keys k1 and k2 are considered equal if and only if (k1==null ?
k2==null : k1.equals(k2)).)
It implements the Map interface with a hash table, using referenceequality in place of object-equality when comparing keys (and
values).