Search in sources :

Example 1 with ImmutableBooleanCollection

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

the class AbstractImmutableListTestCase method collectBoolean.

@Override
@Test
public void collectBoolean() {
    ImmutableCollection<Integer> integers = this.classUnderTest();
    ImmutableBooleanCollection immutableCollection = integers.collectBoolean(PrimitiveFunctions.integerIsPositive());
    Verify.assertSize(integers.size(), immutableCollection);
}
Also used : ImmutableBooleanCollection(org.eclipse.collections.api.collection.primitive.ImmutableBooleanCollection) Test(org.junit.Test)

Example 2 with ImmutableBooleanCollection

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

the class AbstractImmutableBooleanBagTestCase method testEquals.

@Override
@Test
public void testEquals() {
    super.testEquals();
    ImmutableBooleanCollection collection1 = this.newWith(true, false, true, false);
    ImmutableBooleanCollection collection2 = this.newWith(true, false, false, true);
    ImmutableBooleanCollection collection3 = this.newWith(true, false);
    ImmutableBooleanCollection collection4 = this.newWith(true, true, false);
    Assert.assertEquals(collection1, collection2);
    Verify.assertPostSerializedIdentity(this.newWith());
    Assert.assertNotEquals(collection3, collection4);
    Assert.assertNotEquals(collection3, BooleanArrayList.newListWith(true, false));
    Assert.assertNotEquals(this.newWith(true), BooleanArrayList.newListWith(true));
    Assert.assertNotEquals(this.newWith(), BooleanArrayList.newListWith());
}
Also used : ImmutableBooleanCollection(org.eclipse.collections.api.collection.primitive.ImmutableBooleanCollection) Test(org.junit.Test)

Example 3 with ImmutableBooleanCollection

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

the class ImmutableBooleanHashSetTest method newWithoutAll.

@Override
@Test
public void newWithoutAll() {
    ImmutableBooleanCollection collection3 = this.newWith(true, false);
    ImmutableBooleanCollection collection2 = collection3.newWithoutAll(this.newMutableCollectionWith(true));
    ImmutableBooleanCollection collection1 = collection3.newWithoutAll(this.newMutableCollectionWith(false));
    ImmutableBooleanCollection collection0 = collection3.newWithoutAll(this.newMutableCollectionWith(true, false));
    this.assertSizeAndContains(collection0);
    this.assertSizeAndContains(collection1, true);
    this.assertSizeAndContains(collection2, false);
}
Also used : ImmutableBooleanCollection(org.eclipse.collections.api.collection.primitive.ImmutableBooleanCollection) Test(org.junit.Test)

Example 4 with ImmutableBooleanCollection

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

the class ImmutableBooleanHashSetTest method newWithAll.

@Override
@Test
public void newWithAll() {
    ImmutableBooleanCollection immutableCollection = this.newWith();
    ImmutableBooleanCollection collection = immutableCollection.newWithAll(this.newMutableCollectionWith(true));
    ImmutableBooleanCollection collection0 = immutableCollection.newWithAll(this.newMutableCollectionWith(false));
    ImmutableBooleanCollection collection1 = immutableCollection.newWithAll(this.newMutableCollectionWith(true, false));
    this.assertSizeAndContains(immutableCollection);
    this.assertSizeAndContains(collection, true);
    this.assertSizeAndContains(collection0, false);
    this.assertSizeAndContains(collection1, true, false);
}
Also used : ImmutableBooleanCollection(org.eclipse.collections.api.collection.primitive.ImmutableBooleanCollection) Test(org.junit.Test)

Example 5 with ImmutableBooleanCollection

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

the class ImmutableBooleanHashSetTest method testNewWith.

@Override
@Test
public void testNewWith() {
    ImmutableBooleanCollection immutableCollection = this.newWith();
    ImmutableBooleanCollection collection = immutableCollection.newWith(true);
    ImmutableBooleanCollection collection0 = immutableCollection.newWith(true).newWith(false);
    this.assertSizeAndContains(immutableCollection);
    this.assertSizeAndContains(collection, true);
    this.assertSizeAndContains(collection0, true, false);
}
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