use of com.b2international.collections.longs.LongSet in project snow-owl by b2ihealthcare.
the class LongOpenHashSetTest method iterator_empty.
@Test
public void iterator_empty() {
LongSet longSet = PrimitiveSets.newLongOpenHashSet();
LongIterator itr = longSet.iterator();
assertFalse("Iterator should indicate that there are no elements.", itr.hasNext());
}
use of com.b2international.collections.longs.LongSet in project snow-owl by b2ihealthcare.
the class LongOpenHashSetTest method addAll.
@Test
public void addAll() {
LongSet longSet = PrimitiveSets.newLongOpenHashSet();
LongSet otherSet = PrimitiveSets.newLongOpenHashSet();
otherSet.add(0L);
otherSet.add(5L);
otherSet.add(10L);
longSet.addAll(otherSet);
assertEquals("Long set size should be 3.", 3, longSet.size());
assertTrue("Long set should contain element 0.", longSet.contains(0L));
assertTrue("Long set should contain element 5.", longSet.contains(5L));
assertTrue("Long set should contain element 10.", longSet.contains(10L));
}
use of com.b2international.collections.longs.LongSet in project snow-owl by b2ihealthcare.
the class LongOpenHashSetTest method containsAll.
@Test
public void containsAll() {
LongSet longSet = PrimitiveSets.newLongOpenHashSet();
LongSet otherSet = PrimitiveSets.newLongOpenHashSet();
longSet.add(0L);
longSet.add(5L);
longSet.add(10L);
otherSet.add(0L);
otherSet.add(5L);
otherSet.add(10L);
assertTrue("First set should contain all elements from second set.", longSet.containsAll(otherSet));
assertTrue("Second set should contain all elements from first set.", otherSet.containsAll(longSet));
}
use of com.b2international.collections.longs.LongSet in project snow-owl by b2ihealthcare.
the class LongOpenHashSetTest method removeAll_superset.
@Test
public void removeAll_superset() {
LongSet longSet = PrimitiveSets.newLongOpenHashSet();
LongSet otherSet = PrimitiveSets.newLongOpenHashSet();
longSet.add(0L);
longSet.add(5L);
longSet.add(10L);
otherSet.add(0L);
otherSet.add(5L);
otherSet.add(10L);
otherSet.add(30L);
longSet.removeAll(otherSet);
assertTrue("Long set should be empty after removing all elements.", longSet.isEmpty());
}
use of com.b2international.collections.longs.LongSet in project snow-owl by b2ihealthcare.
the class LongOpenHashSetTest method removeAll_same.
@Test
public void removeAll_same() {
LongSet longSet = PrimitiveSets.newLongOpenHashSet();
LongSet otherSet = PrimitiveSets.newLongOpenHashSet();
longSet.add(0L);
longSet.add(5L);
longSet.add(10L);
otherSet.add(0L);
otherSet.add(5L);
otherSet.add(10L);
longSet.removeAll(otherSet);
assertTrue("Long set should be empty after removing all elements.", longSet.isEmpty());
}
Aggregations