Search in sources :

Example 16 with ImmutableBooleanCollection

use of org.eclipse.collections.api.collection.primitive.ImmutableBooleanCollection in project eclipse-collections by eclipse.

the class AbstractImmutableBooleanCollectionTestCase method testNewWith.

@Test
public void testNewWith() {
    ImmutableBooleanCollection immutableCollection = this.newWith();
    ImmutableBooleanCollection collection = immutableCollection.newWith(true);
    ImmutableBooleanCollection collection0 = immutableCollection.newWith(true).newWith(false);
    ImmutableBooleanCollection collection1 = immutableCollection.newWith(true).newWith(false).newWith(true);
    ImmutableBooleanCollection collection2 = immutableCollection.newWith(true).newWith(false).newWith(true).newWith(false);
    ImmutableBooleanCollection collection3 = immutableCollection.newWith(true).newWith(false).newWith(true).newWith(false).newWith(true);
    this.assertSizeAndOccurrences(immutableCollection, 0, 0);
    this.assertSizeAndOccurrences(collection, 1, 0);
    this.assertSizeAndOccurrences(collection0, 1, 1);
    this.assertSizeAndOccurrences(collection1, 2, 1);
    this.assertSizeAndOccurrences(collection2, 2, 2);
    this.assertSizeAndOccurrences(collection3, 3, 2);
}
Also used : ImmutableBooleanCollection(org.eclipse.collections.api.collection.primitive.ImmutableBooleanCollection) Test(org.junit.Test)

Aggregations

ImmutableBooleanCollection (org.eclipse.collections.api.collection.primitive.ImmutableBooleanCollection)16 Test (org.junit.Test)16 MutableBooleanList (org.eclipse.collections.api.list.primitive.MutableBooleanList)4 MutableBooleanCollection (org.eclipse.collections.api.collection.primitive.MutableBooleanCollection)1