use of com.b2international.collections.longs.LongSet in project snow-owl by b2ihealthcare.
the class LongOpenHashSetTest method removeAll.
@Test
public void removeAll() {
LongSet longSet = PrimitiveSets.newLongOpenHashSet();
LongSet otherSet = PrimitiveSets.newLongOpenHashSet();
longSet.add(0L);
longSet.add(5L);
longSet.add(10L);
otherSet.add(0L);
otherSet.add(10L);
longSet.removeAll(otherSet);
assertEquals("Only one element should remain after removing the others.", 1, longSet.size());
assertTrue("Long set should contain element 5.", longSet.contains(5L));
}
use of com.b2international.collections.longs.LongSet in project snow-owl by b2ihealthcare.
the class LongOpenHashSetTest method addAll_null.
@Test(expected = NullPointerException.class)
public void addAll_null() {
LongSet longSet = PrimitiveSets.newLongOpenHashSet();
longSet.addAll(null);
}
use of com.b2international.collections.longs.LongSet in project snow-owl by b2ihealthcare.
the class LongOpenHashSetTest method containsAll_null.
@Test(expected = NullPointerException.class)
public void containsAll_null() {
LongSet longSet = PrimitiveSets.newLongOpenHashSet();
longSet.containsAll(null);
}
use of com.b2international.collections.longs.LongSet in project snow-owl by b2ihealthcare.
the class LongOpenHashSetTest method containsAll_disjoint_set.
@Test
public void containsAll_disjoint_set() {
LongSet longSet = PrimitiveSets.newLongOpenHashSet();
LongSet otherSet = PrimitiveSets.newLongOpenHashSet();
longSet.add(0L);
longSet.add(5L);
longSet.add(10L);
otherSet.add(-10L);
otherSet.add(0L);
otherSet.add(5L);
assertFalse("First set should not contain all elements from second set.", longSet.containsAll(otherSet));
assertFalse("Second set should not 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_disjoint_set.
@Test
public void removeAll_disjoint_set() {
LongSet longSet = PrimitiveSets.newLongOpenHashSet();
LongSet otherSet = PrimitiveSets.newLongOpenHashSet();
longSet.add(0L);
longSet.add(5L);
longSet.add(10L);
otherSet.add(2L);
otherSet.add(3L);
otherSet.add(4L);
longSet.removeAll(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));
}
Aggregations