use of org.eclipse.collections.api.block.function.primitive.BooleanToObjectFunction in project eclipse-collections by eclipse.
the class AbstractImmutableBooleanBagTestCase method collect.
@Override
@Test
public void collect() {
super.collect();
ImmutableBooleanBag bag = this.newWith(true, false, false, true, true, true);
BooleanToObjectFunction<String> stringValueOf = parameter -> parameter ? "true" : "false";
Assert.assertEquals(HashBag.newBagWith("true", "false", "false", "true", "true", "true"), bag.collect(stringValueOf));
ImmutableBooleanBag bag1 = this.newWith(false, false);
Assert.assertEquals(HashBag.newBagWith("false", "false"), bag1.collect(stringValueOf));
ImmutableBooleanBag bag2 = this.newWith(true, true);
Assert.assertEquals(HashBag.newBagWith("true", "true"), bag2.collect(stringValueOf));
}
use of org.eclipse.collections.api.block.function.primitive.BooleanToObjectFunction in project eclipse-collections by eclipse.
the class AbstractMutableBooleanBagTestCase method collect.
@Override
@Test
public void collect() {
super.collect();
MutableBooleanBag bag = this.newWith(true, false, false, true, true, true);
BooleanToObjectFunction<String> stringValueOf = parameter -> parameter ? "true" : "false";
Assert.assertEquals(HashBag.newBagWith("true", "false", "false", "true", "true", "true"), bag.collect(stringValueOf));
MutableBooleanBag bag1 = this.newWith(false, false);
Assert.assertEquals(HashBag.newBagWith("false", "false"), bag1.collect(stringValueOf));
MutableBooleanBag bag2 = this.newWith(true, true);
Assert.assertEquals(HashBag.newBagWith("true", "true"), bag2.collect(stringValueOf));
}
Aggregations