use of com.b2international.collections.ints.IntSet in project snow-owl by b2ihealthcare.
the class IntOpenHashSetTest method create_zero_size.
@Test
public void create_zero_size() {
IntSet intSet = PrimitiveSets.newIntOpenHashSetWithExpectedSize(0);
assertTrue("Integer set should be empty.", intSet.isEmpty());
}
use of com.b2international.collections.ints.IntSet in project snow-owl by b2ihealthcare.
the class IntOpenHashSetTest method retainAll_same.
@Test
public void retainAll_same() {
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);
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 retainAll.
@Test
public void retainAll() {
IntSet intSet = PrimitiveSets.newIntOpenHashSet();
IntSet otherSet = PrimitiveSets.newIntOpenHashSet();
intSet.add(0);
intSet.add(5);
intSet.add(10);
otherSet.add(0);
otherSet.add(10);
intSet.retainAll(otherSet);
assertEquals("Two elements should remain after retaining.", 2, intSet.size());
assertTrue("Integer set should contain element 0.", intSet.contains(0));
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 removeAll_superset.
@Test
public void removeAll_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.removeAll(otherSet);
assertTrue("Integer set should be empty after removing all elements.", intSet.isEmpty());
}
use of com.b2international.collections.ints.IntSet in project snow-owl by b2ihealthcare.
the class IntOpenHashSetTest method removeAll.
@Test
public void removeAll() {
IntSet intSet = PrimitiveSets.newIntOpenHashSet();
IntSet otherSet = PrimitiveSets.newIntOpenHashSet();
intSet.add(0);
intSet.add(5);
intSet.add(10);
otherSet.add(0);
otherSet.add(10);
intSet.removeAll(otherSet);
assertEquals("Only one element should remain after removing the others.", 1, intSet.size());
assertTrue("Integer set should contain element 5.", intSet.contains(5));
}
Aggregations