use of com.b2international.collections.ints.IntSet in project snow-owl by b2ihealthcare.
the class IntOpenHashSetTest method iterator_empty.
@Test
public void iterator_empty() {
IntSet intSet = PrimitiveSets.newIntOpenHashSet();
IntIterator itr = intSet.iterator();
assertFalse("Iterator should indicate that there are no elements.", itr.hasNext());
}
use of com.b2international.collections.ints.IntSet in project snow-owl by b2ihealthcare.
the class IntOpenHashSetTest method removeAll_same.
@Test
public void removeAll_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.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 containsAll_disjoint_set.
@Test
public void containsAll_disjoint_set() {
IntSet intSet = PrimitiveSets.newIntOpenHashSet();
IntSet otherSet = PrimitiveSets.newIntOpenHashSet();
intSet.add(0);
intSet.add(5);
intSet.add(10);
otherSet.add(-10);
otherSet.add(0);
otherSet.add(5);
assertFalse("First set should not contain all elements from second set.", intSet.containsAll(otherSet));
assertFalse("Second set should not 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 containsAll_subset.
@Test
public void containsAll_subset() {
IntSet intSet = PrimitiveSets.newIntOpenHashSet();
IntSet otherSet = PrimitiveSets.newIntOpenHashSet();
intSet.add(0);
intSet.add(5);
intSet.add(10);
otherSet.add(0);
otherSet.add(5);
assertTrue("First set should contain all elements from second set.", intSet.containsAll(otherSet));
assertFalse("Second set should not 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 toString_empty.
@Test
public void toString_empty() {
IntSet intSet = PrimitiveSets.newIntOpenHashSet();
assertEquals("ToString output should be [] for the empty set.", "[]", intSet.toString());
}
Aggregations