Can it be?
Set set1 = new HashSet(5);
Set set2 = new HashSet(5);
// add of bunch of strings to both sets
assert set1.equals(set2) == false;
Yes it can!
We actually had this problem in an integration test. The cause was that the strings to one set were added concurrently. Interestingly, the sets seemed to be the same, when printed they contained the same strings, just in a different order (
↧