Search in sources :

Example 1 with IntSet

use of com.b2international.collections.ints.IntSet in project snow-owl by b2ihealthcare.

the class IntOpenHashSetTest method addAll_null.

@Test(expected = NullPointerException.class)
public void addAll_null() {
    IntSet intSet = PrimitiveSets.newIntOpenHashSet();
    intSet.addAll(null);
}
Also used : IntSet(com.b2international.collections.ints.IntSet) Test(org.junit.Test)

Example 2 with IntSet

use of com.b2international.collections.ints.IntSet in project snow-owl by b2ihealthcare.

the class IntOpenHashSetTest method toArray_empty.

@Test
public void toArray_empty() {
    IntSet intSet = PrimitiveSets.newIntOpenHashSet();
    int[] array = intSet.toArray();
    assertEquals("Array should be empty for empty sets.", 0, array.length);
}
Also used : IntSet(com.b2international.collections.ints.IntSet) Test(org.junit.Test)

Example 3 with IntSet

use of com.b2international.collections.ints.IntSet in project snow-owl by b2ihealthcare.

the class IntOpenHashSetTest method addAll_empty.

@Test
public void addAll_empty() {
    IntSet intSet = PrimitiveSets.newIntOpenHashSet();
    intSet.addAll(PrimitiveSets.newIntOpenHashSet());
    assertTrue("Integer set should be empty.", intSet.isEmpty());
}
Also used : IntSet(com.b2international.collections.ints.IntSet) Test(org.junit.Test)

Example 4 with IntSet

use of com.b2international.collections.ints.IntSet in project snow-owl by b2ihealthcare.

the class IntOpenHashSetTest method containsAll_empty.

@Test
public void containsAll_empty() {
    IntSet intSet = PrimitiveSets.newIntOpenHashSet();
    intSet.add(0);
    assertTrue("Set should contain all elements from an empty set.", intSet.containsAll(PrimitiveSets.newIntOpenHashSet()));
}
Also used : IntSet(com.b2international.collections.ints.IntSet) Test(org.junit.Test)

Example 5 with IntSet

use of com.b2international.collections.ints.IntSet in project snow-owl by b2ihealthcare.

the class IntOpenHashSetTest method containsAll_null.

@Test(expected = NullPointerException.class)
public void containsAll_null() {
    IntSet intSet = PrimitiveSets.newIntOpenHashSet();
    intSet.containsAll(null);
}
Also used : IntSet(com.b2international.collections.ints.IntSet) Test(org.junit.Test)

Aggregations

IntSet (com.b2international.collections.ints.IntSet)43 Test (org.junit.Test)38 IntIterator (com.b2international.collections.ints.IntIterator)4 PrimitiveSets (com.b2international.collections.PrimitiveSets)2 Comparator (java.util.Comparator)2 List (java.util.List)2 LongSet (com.b2international.collections.longs.LongSet)1 Preconditions.checkArgument (com.google.common.base.Preconditions.checkArgument)1 Preconditions.checkNotNull (com.google.common.base.Preconditions.checkNotNull)1 Preconditions.checkState (com.google.common.base.Preconditions.checkState)1 ImmutableList (com.google.common.collect.ImmutableList)1 Lists.newArrayList (com.google.common.collect.Lists.newArrayList)1 AbstractSet (java.util.AbstractSet)1 Iterator (java.util.Iterator)1 Objects (java.util.Objects)1