use of com.b2international.collections.longs.LongSet in project snow-owl by b2ihealthcare.
the class LongOpenHashSetTest method add.
@Test
public void add() {
LongSet longSet = PrimitiveSets.newLongOpenHashSet();
longSet.add(0L);
longSet.add(5L);
longSet.add(10L);
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 toArray_empty.
@Test
public void toArray_empty() {
LongSet longSet = PrimitiveSets.newLongOpenHashSet();
long[] array = longSet.toArray();
assertEquals("Array should be empty for empty sets.", 0, array.length);
}
use of com.b2international.collections.longs.LongSet in project snow-owl by b2ihealthcare.
the class LongOpenHashSetTest method contains_false_after_remove.
@Test
public void contains_false_after_remove() {
LongSet longSet = PrimitiveSets.newLongOpenHashSet();
longSet.add(0L);
longSet.add(5L);
longSet.add(10L);
longSet.remove(0L);
longSet.remove(5L);
longSet.remove(10L);
assertEquals("Long set size should be 0.", 0, longSet.size());
assertTrue("Long set should be empty.", longSet.isEmpty());
assertFalse("Long set should not contain element 0.", longSet.contains(0L));
assertFalse("Long set should not contain element 5.", longSet.contains(5L));
assertFalse("Long set should not contain element 10.", longSet.contains(10L));
}
use of com.b2international.collections.longs.LongSet in project snow-owl by b2ihealthcare.
the class LongOpenHashSetTest method create_collection.
@Test
public void create_collection() {
LongSet longSet = PrimitiveSets.newLongOpenHashSet(PrimitiveLists.newLongArrayList(0L, 5L, 10L, 5L));
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 create_empty_array.
@Test
public void create_empty_array() {
LongSet longSet = PrimitiveSets.newLongOpenHashSet(new long[0]);
assertTrue("Long set should be empty.", longSet.isEmpty());
}
Aggregations