use of org.eclipse.collections.api.bag.primitive.ImmutableBooleanBag in project eclipse-collections by eclipse.
the class ImmutableEmptyBagTest method collectBoolean.
@Override
@Test
public void collectBoolean() {
ImmutableBooleanBag result = this.newBag().collectBoolean("4"::equals);
Assert.assertEquals(0, result.sizeDistinct());
Assert.assertEquals(0, result.occurrencesOf(true));
Assert.assertEquals(0, result.occurrencesOf(false));
}
use of org.eclipse.collections.api.bag.primitive.ImmutableBooleanBag in project eclipse-collections by eclipse.
the class ImmutableHashBagTest method collectBoolean.
@Override
@Test
public void collectBoolean() {
ImmutableBooleanBag result = this.newBag().collectBoolean("4"::equals);
Assert.assertEquals(2, result.sizeDistinct());
Assert.assertEquals(4, result.occurrencesOf(true));
Assert.assertEquals(6, result.occurrencesOf(false));
}
use of org.eclipse.collections.api.bag.primitive.ImmutableBooleanBag in project eclipse-collections by eclipse.
the class ImmutableSingletonBagTest method collectBoolean.
@Override
@Test
public void collectBoolean() {
ImmutableBooleanBag result = this.newBag().collectBoolean("4"::equals);
Assert.assertEquals(1, result.sizeDistinct());
Assert.assertEquals(0, result.occurrencesOf(true));
Assert.assertEquals(1, result.occurrencesOf(false));
}
use of org.eclipse.collections.api.bag.primitive.ImmutableBooleanBag in project eclipse-collections by eclipse.
the class AbstractImmutableBooleanBagTestCase method allSatisfy.
@Override
@Test
public void allSatisfy() {
super.allSatisfy();
int[] count = { 0 };
ImmutableBooleanBag bag = this.newWith(false, true, false);
Assert.assertFalse(bag.allSatisfy(value -> {
count[0]++;
return !value;
}));
Assert.assertEquals(2L, count[0]);
}
use of org.eclipse.collections.api.bag.primitive.ImmutableBooleanBag in project eclipse-collections by eclipse.
the class AbstractImmutableBooleanBagTestCase method toImmutable.
@Test
public void toImmutable() {
Assert.assertEquals(this.classUnderTest(), this.classUnderTest().toImmutable());
ImmutableBooleanBag expected = this.classUnderTest();
Assert.assertSame(expected, expected.toImmutable());
}
Aggregations