use of org.graalvm.collections.Equivalence in project graal by oracle.
the class EconomicMapImplTest method testNewEquivalence.
@Test
public void testNewEquivalence() {
EconomicSet<Integer> set = EconomicSet.create(new Equivalence() {
@Override
public boolean equals(Object a, Object b) {
return false;
}
@Override
public int hashCode(Object o) {
return 0;
}
});
set.addAll(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9));
Assert.assertTrue(set.add(new Integer(0)));
}
Aggregations