use of org.eclipse.collections.impl.bag.mutable.primitive.BooleanHashBag in project eclipse-collections by eclipse.
the class AbstractMutableMap method collectBoolean.
@Override
public MutableBooleanBag collectBoolean(BooleanFunction<? super V> booleanFunction) {
MutableBooleanBag result = new BooleanHashBag();
this.forEach(new CollectBooleanProcedure<>(booleanFunction, result));
return result;
}
use of org.eclipse.collections.impl.bag.mutable.primitive.BooleanHashBag in project eclipse-collections by eclipse.
the class AbstractBooleanSetTestCase method toBag.
@Override
@Test
public void toBag() {
Assert.assertEquals(new BooleanHashBag(), this.emptySet.toBag());
Assert.assertEquals(BooleanHashBag.newBagWith(false), this.setWithFalse.toBag());
Assert.assertEquals(BooleanHashBag.newBagWith(true), this.setWithTrue.toBag());
Assert.assertEquals(BooleanHashBag.newBagWith(false, true), this.setWithTrueFalse.toBag());
}
use of org.eclipse.collections.impl.bag.mutable.primitive.BooleanHashBag in project eclipse-collections by eclipse.
the class ImmutableBooleanHashSetTest method toBag.
@Override
@Test
public void toBag() {
Assert.assertEquals(new BooleanHashBag(), this.emptySet.toBag());
Assert.assertEquals(BooleanHashBag.newBagWith(false), this.falseSet.toBag());
Assert.assertEquals(BooleanHashBag.newBagWith(true), this.trueSet.toBag());
Assert.assertEquals(BooleanHashBag.newBagWith(false, true), this.trueFalseSet.toBag());
}
use of org.eclipse.collections.impl.bag.mutable.primitive.BooleanHashBag in project eclipse-collections by eclipse.
the class BooleanBagsTest method newBagWithBag.
@Test
public void newBagWithBag() {
ImmutableBooleanBag bag = BooleanBags.immutable.of();
BooleanHashBag booleanHashBag = BooleanHashBag.newBagWith(true);
Assert.assertEquals(bag = bag.newWith(true), booleanHashBag.toImmutable());
Assert.assertEquals(bag = bag.newWith(false), booleanHashBag.with(false).toImmutable());
Assert.assertEquals(bag = bag.newWith(true), booleanHashBag.with(true).toImmutable());
Assert.assertEquals(bag = bag.newWith(false), booleanHashBag.with(false).toImmutable());
Assert.assertEquals(bag = bag.newWith(true), booleanHashBag.with(true).toImmutable());
Assert.assertEquals(bag = bag.newWith(false), booleanHashBag.with(false).toImmutable());
Assert.assertEquals(bag = bag.newWith(true), booleanHashBag.with(true).toImmutable());
Assert.assertEquals(bag = bag.newWith(true), booleanHashBag.with(true).toImmutable());
Assert.assertEquals(bag = bag.newWith(true), booleanHashBag.with(true).toImmutable());
Assert.assertEquals(bag = bag.newWith(false), booleanHashBag.with(false).toImmutable());
Assert.assertEquals(bag = bag.newWith(true), booleanHashBag.with(true).toImmutable());
}
use of org.eclipse.collections.impl.bag.mutable.primitive.BooleanHashBag in project eclipse-collections by eclipse.
the class BooleanBagsTest method newBagWithWithBag.
@Test
public void newBagWithWithBag() {
Assert.assertEquals(new BooleanHashBag(), BooleanBags.immutable.ofAll(new BooleanHashBag()));
Assert.assertEquals(BooleanHashBag.newBagWith(true), BooleanBags.immutable.ofAll(BooleanHashBag.newBagWith(true)));
Assert.assertEquals(BooleanHashBag.newBagWith(true, false), BooleanBags.immutable.ofAll(BooleanHashBag.newBagWith(true, false)));
Assert.assertEquals(BooleanHashBag.newBagWith(true, false, true), BooleanBags.immutable.ofAll(BooleanHashBag.newBagWith(true, false, true)));
}
Aggregations