Java provides IdentityHashMap which is perfect when you want to compare objects by ==
instead of equals
method.
Guava provides nice wrapper for Map<Key, Set<Value>
which is SetMultimap. However there are no implementation of it which uses identity object comparison (==
).
Is there anything better than plain
IdentityHashMap<Key, IdentityHashSet<Value>>
?
SomeIdentitySetMultimap<Key, Value>
would be ideal.