use of com.b2international.collections.ints.IntSet in project snow-owl by b2ihealthcare.
the class IntOpenHashSetTest method addAll.
@Test
public void addAll() {
IntSet intSet = PrimitiveSets.newIntOpenHashSet();
IntSet otherSet = PrimitiveSets.newIntOpenHashSet();
otherSet.add(0);
otherSet.add(5);
otherSet.add(10);
intSet.addAll(otherSet);
assertEquals("Integer set size should be 3.", 3, intSet.size());
assertTrue("Integer set should contain element 0.", intSet.contains(0));
assertTrue("Integer set should contain element 5.", intSet.contains(5));
assertTrue("Integer set should contain element 10.", intSet.contains(10));
}
use of com.b2international.collections.ints.IntSet in project snow-owl by b2ihealthcare.
the class IntOpenHashSetTest method containsAll.
@Test
public void containsAll() {
IntSet intSet = PrimitiveSets.newIntOpenHashSet();
IntSet otherSet = PrimitiveSets.newIntOpenHashSet();
intSet.add(0);
intSet.add(5);
intSet.add(10);
otherSet.add(0);
otherSet.add(5);
otherSet.add(10);
assertTrue("First set should contain all elements from second set.", intSet.containsAll(otherSet));
assertTrue("Second set should contain all elements from first set.", otherSet.containsAll(intSet));
}
use of com.b2international.collections.ints.IntSet in project snow-owl by b2ihealthcare.
the class IntOpenHashSetTest method retainAll_superset.
@Test
public void retainAll_superset() {
IntSet intSet = PrimitiveSets.newIntOpenHashSet();
IntSet otherSet = PrimitiveSets.newIntOpenHashSet();
intSet.add(0);
intSet.add(5);
intSet.add(10);
otherSet.add(0);
otherSet.add(5);
otherSet.add(10);
otherSet.add(30);
intSet.retainAll(otherSet);
assertEquals("Three elements should remain after retaining.", 3, intSet.size());
assertTrue("Integer set should contain element 0.", intSet.contains(0));
assertTrue("Integer set should contain element 5.", intSet.contains(5));
assertTrue("Integer set should contain element 10.", intSet.contains(10));
}
use of com.b2international.collections.ints.IntSet in project snow-owl by b2ihealthcare.
the class IntOpenHashSetTest method equals_false.
@Test
public void equals_false() {
IntSet intSet = PrimitiveSets.newIntOpenHashSet();
IntSet otherSet = PrimitiveSets.newIntOpenHashSet();
intSet.add(0);
intSet.add(5);
intSet.add(10);
otherSet.add(0);
otherSet.add(1);
otherSet.add(2);
assertFalse("First set should not be equal to second set.", intSet.equals(otherSet));
assertFalse("Second set should not be equal to first set.", otherSet.equals(intSet));
}
use of com.b2international.collections.ints.IntSet in project snow-owl by b2ihealthcare.
the class IntOpenHashSetTest method create_empty_collection.
@Test
public void create_empty_collection() {
IntSet intSet = PrimitiveSets.newIntOpenHashSet(PrimitiveLists.newIntArrayList());
assertTrue("Integer set should be empty.", intSet.isEmpty());
}
Aggregations