use of org.eclipse.collections.api.list.primitive.BooleanList in project eclipse-collections by eclipse.
the class Collectors2AdditionalTest method collectBoolean.
@Test
public void collectBoolean() {
BooleanList expected = SMALL_INTERVAL.collectBoolean(each -> each % 2 == 0, BooleanLists.mutable.empty());
BooleanList actual = this.smallData.stream().collect(Collectors2.collectBoolean(each -> each % 2 == 0, BooleanLists.mutable::empty));
Assert.assertEquals(expected, actual);
}
use of org.eclipse.collections.api.list.primitive.BooleanList in project eclipse-collections by eclipse.
the class Collectors2AdditionalTest method collectBooleanParallel.
@Test
public void collectBooleanParallel() {
BooleanList expected = LARGE_INTERVAL.collectBoolean(each -> each % 2 == 0, BooleanLists.mutable.empty());
BooleanList actual = this.bigData.parallelStream().collect(Collectors2.collectBoolean(each -> each % 2 == 0, BooleanLists.mutable::empty));
Assert.assertEquals(expected, actual);
}
use of org.eclipse.collections.api.list.primitive.BooleanList in project eclipse-collections by eclipse.
the class BooleanCaseProcedureTest method noopCaseAndThenDefault.
@Test
public void noopCaseAndThenDefault() {
MutableBooleanList result = BooleanLists.mutable.empty();
BooleanList source = BooleanLists.mutable.with(true, false);
BooleanCaseProcedure procedure = new BooleanCaseProcedure();
source.each(procedure);
Verify.assertEmpty(result);
procedure.setDefault(result::add);
source.each(procedure);
Assert.assertEquals(result, source);
Verify.assertContains("BooleanCaseProcedure", procedure.toString());
}
Aggregations