In Java 8, I have a HashSet h (correctly typed by generics), with hashCode/equals methods implemented up to the bottom of the type hierarchy - apparently correctly as eclipse did it for me.
In some (rare) cases, the method invokation h.contains(e) returns false - which is wrong (to my understanding) as there is an element e' in the set with both equal hashCodes and the equals method e.equals(e') returning true.
To make my confusion even greater, new HashSet<>(h).contains(e)
returns the correct answer true.
How can this EVER be?
As this rare case is generated at some point in a big program which is hardly retraceable, I cannot provide a MWE, but I can give more information if desired.