use of org.eclipse.collections.impl.set.mutable.primitive.BooleanHashSet in project eclipse-collections by eclipse.
the class AbstractImmutableSet method collectBoolean.
@Override
public ImmutableBooleanSet collectBoolean(BooleanFunction<? super T> booleanFunction) {
MutableBooleanSet result = new BooleanHashSet();
this.forEach(new CollectBooleanProcedure<>(booleanFunction, result));
return result.toImmutable();
}
use of org.eclipse.collections.impl.set.mutable.primitive.BooleanHashSet in project eclipse-collections by eclipse.
the class AbstractMutableSet method collectBoolean.
@Override
public MutableBooleanSet collectBoolean(BooleanFunction<? super T> booleanFunction) {
MutableBooleanSet result = new BooleanHashSet();
this.forEach(new CollectBooleanProcedure<>(booleanFunction, result));
return result;
}
use of org.eclipse.collections.impl.set.mutable.primitive.BooleanHashSet in project eclipse-collections by eclipse.
the class SetAdapter method collectBoolean.
@Override
public MutableBooleanSet collectBoolean(BooleanFunction<? super T> booleanFunction) {
BooleanHashSet result = new BooleanHashSet();
this.forEach(new CollectBooleanProcedure<>(booleanFunction, result));
return result;
}
use of org.eclipse.collections.impl.set.mutable.primitive.BooleanHashSet in project eclipse-collections by eclipse.
the class BooleanSetsTest method immutables.
@Test
public void immutables() {
ImmutableBooleanSetFactory setFactory = BooleanSets.immutable;
Assert.assertEquals(new BooleanHashSet(), setFactory.with());
Verify.assertInstanceOf(ImmutableBooleanSet.class, setFactory.with());
Assert.assertEquals(BooleanHashSet.newSetWith(true), setFactory.with(true));
Verify.assertInstanceOf(ImmutableBooleanSet.class, setFactory.with(true));
Assert.assertEquals(BooleanHashSet.newSetWith(true, false), setFactory.with(true, false));
Verify.assertInstanceOf(ImmutableBooleanSet.class, setFactory.with(true, false));
Assert.assertEquals(BooleanHashSet.newSetWith(true, false, true), setFactory.with(true, false, true));
Verify.assertInstanceOf(ImmutableBooleanSet.class, setFactory.with(true, false, true));
Assert.assertEquals(BooleanHashSet.newSetWith(true, false, true, false), setFactory.with(true, false, true, false));
Verify.assertInstanceOf(ImmutableBooleanSet.class, setFactory.with(true, false, true, false));
Assert.assertEquals(BooleanHashSet.newSetWith(true, false, true, false, true), setFactory.with(true, false, true, false, true));
Verify.assertInstanceOf(ImmutableBooleanSet.class, setFactory.with(true, false, true, false, true));
Assert.assertEquals(BooleanHashSet.newSetWith(true, false, true, false, true, false), setFactory.with(true, false, true, false, true, false));
Verify.assertInstanceOf(ImmutableBooleanSet.class, setFactory.with(true, false, true, false, true, false));
Assert.assertEquals(BooleanHashSet.newSetWith(true, false, true, false, true, false, true), setFactory.with(true, false, true, false, true, false, true));
Verify.assertInstanceOf(ImmutableBooleanSet.class, setFactory.with(true, false, true, false, true, false, true));
Assert.assertEquals(BooleanHashSet.newSetWith(true, false, true, false, true, false, true, true), setFactory.with(true, false, true, false, true, false, true, true));
Verify.assertInstanceOf(ImmutableBooleanSet.class, setFactory.with(true, false, true, false, true, false, true, true));
Assert.assertEquals(BooleanHashSet.newSetWith(true, false, true, false, true, false, true, true, true), setFactory.with(true, false, true, false, true, false, true, true, true));
Verify.assertInstanceOf(ImmutableBooleanSet.class, setFactory.with(true, false, true, false, true, false, true, true, true));
Assert.assertEquals(BooleanHashSet.newSetWith(true, false, true, false, true, false, true, true, true, false), setFactory.with(true, false, true, false, true, false, true, true, true, false));
Verify.assertInstanceOf(ImmutableBooleanSet.class, setFactory.with(true, false, true, false, true, false, true, true, true, false));
Assert.assertEquals(BooleanHashSet.newSetWith(true, false, true), setFactory.withAll(BooleanHashSet.newSetWith(true, false, true)));
Verify.assertInstanceOf(ImmutableBooleanSet.class, setFactory.withAll(BooleanHashSet.newSetWith(true, false, true)));
}
use of org.eclipse.collections.impl.set.mutable.primitive.BooleanHashSet in project eclipse-collections by eclipse.
the class BooleanSetsTest method newSetWithWithSet.
@Test
public void newSetWithWithSet() {
Assert.assertEquals(new BooleanHashSet(), BooleanSets.immutable.withAll(new BooleanHashSet()));
Assert.assertEquals(BooleanHashSet.newSetWith(true), BooleanSets.immutable.withAll(BooleanHashSet.newSetWith(true)));
Assert.assertEquals(BooleanHashSet.newSetWith(true, false), BooleanSets.immutable.withAll(BooleanHashSet.newSetWith(true, false)));
Assert.assertEquals(BooleanHashSet.newSetWith(true, false, true), BooleanSets.immutable.withAll(BooleanHashSet.newSetWith(true, false, true)));
}
Aggregations