use of com.b2international.collections.longs.LongSet in project snow-owl by b2ihealthcare.
the class LongOpenHashSetTest method containsAll_empty.
@Test
public void containsAll_empty() {
LongSet longSet = PrimitiveSets.newLongOpenHashSet();
longSet.add(0L);
assertTrue("Set should contain all elements from an empty set.", longSet.containsAll(PrimitiveSets.newLongOpenHashSet()));
}
use of com.b2international.collections.longs.LongSet in project snow-owl by b2ihealthcare.
the class LongOpenHashSetTest method create_zero_size.
@Test
public void create_zero_size() {
LongSet longSet = PrimitiveSets.newLongOpenHashSetWithExpectedSize(0);
assertTrue("Long set should be empty.", longSet.isEmpty());
}
use of com.b2international.collections.longs.LongSet in project snow-owl by b2ihealthcare.
the class LongOpenHashSetTest method create_hash_function.
@Test
public void create_hash_function() {
LongSet longSet = PrimitiveSets.newLongOpenHashSet(Hashing.murmur3_32());
assertTrue("Long set should be empty.", longSet.isEmpty());
}
use of com.b2international.collections.longs.LongSet in project snow-owl by b2ihealthcare.
the class LongOpenHashSetTest method retainAll.
@Test
public void retainAll() {
LongSet longSet = PrimitiveSets.newLongOpenHashSet();
LongSet otherSet = PrimitiveSets.newLongOpenHashSet();
longSet.add(0L);
longSet.add(5L);
longSet.add(10L);
otherSet.add(0L);
otherSet.add(10L);
longSet.retainAll(otherSet);
assertEquals("Two elements should remain after retaining.", 2, longSet.size());
assertTrue("Long set should contain element 0.", longSet.contains(0L));
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_subset.
@Test
public void containsAll_subset() {
LongSet longSet = PrimitiveSets.newLongOpenHashSet();
LongSet otherSet = PrimitiveSets.newLongOpenHashSet();
longSet.add(0L);
longSet.add(5L);
longSet.add(10L);
otherSet.add(0L);
otherSet.add(5L);
assertTrue("First set should contain all elements from second set.", longSet.containsAll(otherSet));
assertFalse("Second set should not contain all elements from first set.", otherSet.containsAll(longSet));
}
Aggregations