Hello,
First thanks for this great library.
I think I found a bug in code or in JavaDoc: JavaDoc for
ObjectHashSet.add(KType key) says when there is an already existing element with same key, it is replaced with the one provided in argument. But it is not the case.
I made a test to reproduce the problem (using JUnit and HPPC 0.7.2).
@Test
public void add() {
ObjectHashSet<Integer> set = new ObjectHashSet<Integer>();
set.add(new Integer(0));
Integer newKey = new Integer(0);
set.add(newKey);
Integer keyInSet = set.iterator().next().value;
assertSame(newKey, keyInSet); // <-- Fails.
}
The key is not replaced, and KTypeHashSet source code seems to confirm that.
Regards,
Olivier