use of org.eclipse.collections.api.collection.primitive.MutableBooleanCollection in project eclipse-collections by eclipse.
the class AbstractMutableBooleanBagTestCase method testEquals.
@Override
@Test
public void testEquals() {
super.testEquals();
MutableBooleanCollection collection1 = this.newWith(true, false, true, false);
MutableBooleanCollection collection2 = this.newWith(true, false, false, true);
MutableBooleanCollection collection3 = this.newWith(true, false);
MutableBooleanCollection collection4 = this.newWith(true, true, false);
Assert.assertEquals(collection1, collection2);
Assert.assertNotEquals(collection3, collection4);
}
use of org.eclipse.collections.api.collection.primitive.MutableBooleanCollection in project eclipse-collections by eclipse.
the class IterateTest method collectBoolean.
@Test
public void collectBoolean() {
this.iterables.each(each -> {
MutableBooleanCollection result = Iterate.collectBoolean(each, PrimitiveFunctions.integerIsPositive());
Assert.assertTrue(result.containsAll(true, true, true, true, true));
});
Verify.assertThrows(IllegalArgumentException.class, () -> Iterate.collectBoolean(null, PrimitiveFunctions.integerIsPositive()));
}
use of org.eclipse.collections.api.collection.primitive.MutableBooleanCollection in project eclipse-collections by eclipse.
the class MapIterateTest method collectBoolean.
@Test
public void collectBoolean() {
MutableBooleanCollection result = MapIterate.collectBoolean(MapIterateTest.newLittleMap(), PrimitiveFunctions.integerIsPositive());
Assert.assertEquals(BooleanHashBag.newBagWith(true, true), result.toBag());
}
use of org.eclipse.collections.api.collection.primitive.MutableBooleanCollection in project eclipse-collections by eclipse.
the class ObjectBooleanHashMapValuesTestCase method removeAll.
@Override
@Test
public void removeAll() {
Assert.assertFalse(this.newWith().removeAll());
ObjectBooleanHashMap<Integer> map = ObjectBooleanHashMap.newWithKeysValues(1, true, null, false);
MutableBooleanCollection collection = map.values();
Assert.assertFalse(collection.removeAll());
Assert.assertTrue(collection.removeAll(false));
Assert.assertFalse(collection.contains(false));
Assert.assertTrue(collection.contains(true));
Assert.assertFalse(map.contains(false));
Assert.assertTrue(map.contains(true));
Assert.assertTrue(collection.removeAll(true));
Assert.assertTrue(collection.isEmpty());
Assert.assertFalse(collection.contains(true));
Assert.assertFalse(collection.contains(false));
Assert.assertFalse(map.contains(true));
Assert.assertFalse(map.contains(false));
Assert.assertTrue(map.isEmpty());
}
use of org.eclipse.collections.api.collection.primitive.MutableBooleanCollection in project eclipse-collections by eclipse.
the class ObjectBooleanHashMapValuesTestCase method asSynchronized.
@Override
@Test
public void asSynchronized() {
MutableBooleanCollection synch = this.classUnderTest().asSynchronized();
Verify.assertInstanceOf(SynchronizedBooleanCollection.class, synch);
Assert.assertTrue(synch.containsAll(this.classUnderTest()));
}
Aggregations