use of org.eclipse.collections.impl.bag.mutable.primitive.BooleanHashBag in project eclipse-collections by eclipse.
the class ImmutableObjectBooleanSingletonMapTest method reject.
@Override
@Test
public void reject() {
Assert.assertEquals(this.classUnderTest(), this.classUnderTest().reject((object1, value3) -> false));
Assert.assertEquals(this.getEmptyMap(), this.classUnderTest().reject((object, value2) -> true));
Assert.assertEquals(new BooleanHashBag(), this.classUnderTest().reject(value1 -> true).toBag());
Assert.assertEquals(BooleanHashBag.newBagWith(true), this.classUnderTest().reject(value -> false).toBag());
}
use of org.eclipse.collections.impl.bag.mutable.primitive.BooleanHashBag in project eclipse-collections by eclipse.
the class AbstractMutableBooleanCollectionTestCase method retainAll.
@Test
public void retainAll() {
MutableBooleanCollection collection = this.classUnderTest();
Assert.assertFalse(collection.retainAll(this.newMutableCollectionWith(true, false)));
Assert.assertTrue(collection.retainAll(this.newMutableCollectionWith(true)));
Assert.assertEquals(this.newMutableCollectionWith(true, true), collection);
Assert.assertTrue(collection.retainAll(this.newMutableCollectionWith(false, false)));
Assert.assertEquals(this.newMutableCollectionWith(), collection);
MutableBooleanCollection list = this.classUnderTest();
Assert.assertFalse(list.retainAll(BooleanArrayList.newListWith(false, false, true)));
MutableBooleanCollection booleanArrayList = this.newWith(false, false);
Assert.assertFalse(booleanArrayList.retainAll(new BooleanArrayList(false)));
Assert.assertEquals(this.newMutableCollectionWith(false, false), booleanArrayList);
Assert.assertTrue(booleanArrayList.retainAll(new BooleanArrayList(true)));
Assert.assertEquals(this.newMutableCollectionWith(), booleanArrayList);
Assert.assertTrue(list.retainAll(new BooleanArrayList(false)));
Assert.assertEquals(this.newMutableCollectionWith(false), list);
Assert.assertTrue(list.retainAll(new BooleanArrayList()));
Assert.assertEquals(this.newMutableCollectionWith(), list);
Assert.assertFalse(list.retainAll(BooleanArrayList.newListWith(true, false)));
Assert.assertEquals(this.newMutableCollectionWith(), list);
MutableBooleanCollection list1 = this.newWith(true, false, true, true);
Assert.assertFalse(list1.retainAll(BooleanArrayList.newListWith(false, false, true)));
Assert.assertTrue(list1.retainAll(BooleanArrayList.newListWith(false, false)));
Verify.assertSize(1, list1);
Assert.assertFalse(list1.contains(true));
Assert.assertEquals(this.newMutableCollectionWith(false), list1);
Assert.assertTrue(list1.retainAll(BooleanArrayList.newListWith(true, true)));
Assert.assertEquals(this.newMutableCollectionWith(), list1);
MutableBooleanCollection list2 = this.newWith(true, false, true, false, true);
Assert.assertTrue(list2.retainAll(new BooleanHashBag()));
Assert.assertEquals(this.newMutableCollectionWith(), list2);
}
use of org.eclipse.collections.impl.bag.mutable.primitive.BooleanHashBag in project eclipse-collections by eclipse.
the class ImmutableEmptySortedBagTest method collectBoolean_target.
@Override
@Test
public void collectBoolean_target() {
ImmutableSortedBag<Integer> bag = this.classUnderTest();
Assert.assertEquals(new BooleanArrayList(), bag.collectBoolean(each -> false, new BooleanArrayList()));
ImmutableSortedBag<Integer> bag2 = this.classUnderTest();
Assert.assertEquals(new BooleanHashBag(), bag2.collectBoolean(each -> false, new BooleanHashBag()));
}
Aggregations