use of org.eclipse.collections.api.set.primitive.ImmutableBooleanSet in project eclipse-collections by eclipse.
the class ImmutableBooleanEmptySet 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 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 ImmutableTrueSet 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 BooleanSetsTest method newSetWithSet.
@Test
public void newSetWithSet() {
ImmutableBooleanSet set = BooleanSets.immutable.with();
BooleanHashSet booleanHashSet = BooleanHashSet.newSetWith(true);
Assert.assertEquals(set = set.newWith(true), booleanHashSet.toImmutable());
Assert.assertEquals(set = set.newWith(false), booleanHashSet.with(false).toImmutable());
Assert.assertEquals(set = set.newWith(true), booleanHashSet.with(true).toImmutable());
Assert.assertEquals(set = set.newWith(false), booleanHashSet.with(false).toImmutable());
Assert.assertEquals(set = set.newWith(true), booleanHashSet.with(true).toImmutable());
Assert.assertEquals(set = set.newWith(false), booleanHashSet.with(false).toImmutable());
Assert.assertEquals(set = set.newWith(true), booleanHashSet.with(true).toImmutable());
Assert.assertEquals(set = set.newWith(true), booleanHashSet.with(true).toImmutable());
Assert.assertEquals(set = set.newWith(true), booleanHashSet.with(true).toImmutable());
Assert.assertEquals(set = set.newWith(false), booleanHashSet.with(false).toImmutable());
Assert.assertEquals(set = set.newWith(true), booleanHashSet.with(true).toImmutable());
}
use of org.eclipse.collections.api.set.primitive.ImmutableBooleanSet in project eclipse-collections by eclipse.
the class ImmutableBooleanSetFactoryImplTest method ofAll.
@Test
public void ofAll() {
ImmutableBooleanSet set = BooleanSets.immutable.of(true, false);
Assert.assertEquals(BooleanHashSet.newSet(set).toImmutable(), BooleanSets.immutable.ofAll(set));
Assert.assertEquals(BooleanHashSet.newSet(BooleanArrayList.newListWith(true, false, true)).toImmutable(), BooleanSets.immutable.ofAll(BooleanArrayList.newListWith(true, false)));
}
Aggregations