use of org.eclipse.collections.api.set.primitive.ImmutableBooleanSet in project eclipse-collections by eclipse.
the class ImmutableFalseSet method newWithAll.
@Override
public ImmutableBooleanSet newWithAll(BooleanIterable elements) {
ImmutableBooleanSet result = this;
BooleanIterator booleanIterator = elements.booleanIterator();
while (booleanIterator.hasNext()) {
result = result.newWith(booleanIterator.next());
}
return result;
}
use of org.eclipse.collections.api.set.primitive.ImmutableBooleanSet in project eclipse-collections by eclipse.
the class ImmutableTrueFalseSet method newWithoutAll.
@Override
public ImmutableBooleanSet newWithoutAll(BooleanIterable elements) {
ImmutableBooleanSet result = this;
BooleanIterator booleanIterator = elements.booleanIterator();
while (booleanIterator.hasNext()) {
result = result.newWithout(booleanIterator.next());
}
return result;
}
use of org.eclipse.collections.api.set.primitive.ImmutableBooleanSet in project eclipse-collections by eclipse.
the class ImmutableBooleanHashSetTest method newCollectionWith.
@Override
@Test
public void newCollectionWith() {
ImmutableBooleanSet set = this.classUnderTest();
Verify.assertSize(2, set);
Assert.assertTrue(set.containsAll(true, false, true));
}
use of org.eclipse.collections.api.set.primitive.ImmutableBooleanSet in project eclipse-collections by eclipse.
the class AbstractImmutableEmptySetTestCase method collectBoolean.
@Override
@Test
public void collectBoolean() {
ImmutableSet<Integer> integers = this.classUnderTest();
ImmutableBooleanSet actual = integers.collectBoolean(PrimitiveFunctions.integerIsPositive());
Verify.assertEmpty(actual);
}
use of org.eclipse.collections.api.set.primitive.ImmutableBooleanSet in project eclipse-collections by eclipse.
the class BooleanSetsTest method newSetWithArray.
@SuppressWarnings("RedundantArrayCreation")
@Test
public void newSetWithArray() {
ImmutableBooleanSet set = BooleanSets.immutable.with();
Assert.assertEquals(set = set.newWith(true), BooleanSets.immutable.with(new boolean[] { true }));
Assert.assertEquals(set = set.newWith(false), BooleanSets.immutable.with(new boolean[] { true, false }));
Assert.assertEquals(set = set.newWith(true), BooleanSets.immutable.with(new boolean[] { true, false, true }));
Assert.assertEquals(set = set.newWith(false), BooleanSets.immutable.with(new boolean[] { true, false, true, false }));
Assert.assertEquals(set = set.newWith(true), BooleanSets.immutable.with(new boolean[] { true, false, true, false, true }));
Assert.assertEquals(set = set.newWith(false), BooleanSets.immutable.with(new boolean[] { true, false, true, false, true, false }));
Assert.assertEquals(set = set.newWith(true), BooleanSets.immutable.with(new boolean[] { true, false, true, false, true, false, true }));
Assert.assertEquals(set = set.newWith(true), BooleanSets.immutable.with(new boolean[] { true, false, true, false, true, false, true, true }));
Assert.assertEquals(set = set.newWith(true), BooleanSets.immutable.with(new boolean[] { true, false, true, false, true, false, true, true, true }));
Assert.assertEquals(set = set.newWith(false), BooleanSets.immutable.with(new boolean[] { true, false, true, false, true, false, true, true, true, false }));
Assert.assertEquals(set = set.newWith(true), BooleanSets.immutable.with(new boolean[] { true, false, true, false, true, false, true, true, true, false, true }));
}
Aggregations