I can see that this is a "historical" issue. It looks like still exists in 4, because IdentityMap.entrySet still creates "usual" HashSet and enters all elements in th set one-by-one.