use of org.eclipse.collections.api.collection.primitive.MutableBooleanCollection in project eclipse-collections by eclipse.
the class ObjectBooleanHashMapValuesTestCase method asUnmodifiable.
@Override
@Test
public void asUnmodifiable() {
MutableBooleanCollection unmodifiable = this.classUnderTest().asUnmodifiable();
Verify.assertInstanceOf(UnmodifiableBooleanCollection.class, unmodifiable);
Assert.assertTrue(unmodifiable.containsAll(this.classUnderTest()));
}
use of org.eclipse.collections.api.collection.primitive.MutableBooleanCollection in project eclipse-collections by eclipse.
the class ObjectBooleanHashMapValuesTestCase method containsAllArray.
@Override
public void containsAllArray() {
MutableBooleanCollection emptyCollection = this.newWith();
Assert.assertFalse(emptyCollection.containsAll(true));
Assert.assertFalse(emptyCollection.containsAll(false));
Assert.assertFalse(emptyCollection.containsAll(false, true, false));
MutableBooleanCollection collection = this.classUnderTest();
Assert.assertTrue(collection.containsAll());
Assert.assertTrue(collection.containsAll(true));
Assert.assertTrue(collection.containsAll(false));
Assert.assertTrue(collection.containsAll(false, true));
}
use of org.eclipse.collections.api.collection.primitive.MutableBooleanCollection in project eclipse-collections by eclipse.
the class ObjectBooleanHashMapValuesTestCase method removeAll_iterable.
@Override
@Test
public void removeAll_iterable() {
Assert.assertFalse(this.newWith().removeAll(new BooleanArrayList()));
ObjectBooleanHashMap<Integer> map = ObjectBooleanHashMap.newWithKeysValues(1, true, null, false);
MutableBooleanCollection collection = map.values();
Assert.assertFalse(collection.removeAll());
Assert.assertTrue(collection.removeAll(BooleanArrayList.newListWith(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(BooleanArrayList.newListWith(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());
ObjectBooleanHashMap<Integer> map1 = ObjectBooleanHashMap.newWithKeysValues(1, true, null, false);
MutableBooleanCollection collection1 = map1.values();
Assert.assertTrue(collection1.removeAll(BooleanArrayList.newListWith(true, false)));
Assert.assertTrue(collection1.isEmpty());
Assert.assertFalse(collection1.contains(true));
Assert.assertFalse(collection.contains(false));
Assert.assertFalse(map1.contains(true));
Assert.assertFalse(map1.contains(false));
Assert.assertTrue(map1.isEmpty());
}
use of org.eclipse.collections.api.collection.primitive.MutableBooleanCollection in project eclipse-collections by eclipse.
the class ObjectBooleanHashMapValuesTestCase method retainAll.
@Override
@Test
public void retainAll() {
Assert.assertFalse(this.newWith().retainAll());
ObjectBooleanHashMap<Integer> map = ObjectBooleanHashMap.newWithKeysValues(1, true, null, false);
MutableBooleanCollection collection = map.values();
Assert.assertFalse(collection.retainAll(false, true));
Assert.assertTrue(collection.retainAll(true));
Assert.assertFalse(collection.contains(false));
Assert.assertTrue(collection.contains(true));
Assert.assertFalse(map.contains(false));
Assert.assertTrue(map.contains(true));
Assert.assertTrue(collection.retainAll(false));
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());
ObjectBooleanHashMap<Integer> map1 = ObjectBooleanHashMap.newWithKeysValues(1, true, null, false);
MutableBooleanCollection collection1 = map1.values();
Assert.assertTrue(collection1.retainAll());
Assert.assertTrue(collection1.isEmpty());
Assert.assertFalse(collection1.contains(true));
Assert.assertFalse(collection.contains(false));
Assert.assertFalse(map1.contains(true));
Assert.assertFalse(map1.contains(false));
Assert.assertTrue(map1.isEmpty());
}
use of org.eclipse.collections.api.collection.primitive.MutableBooleanCollection in project eclipse-collections by eclipse.
the class ObjectBooleanHashMapValuesTestCase method containsAllIterable.
@Override
public void containsAllIterable() {
MutableBooleanCollection emptyCollection1 = this.newWith();
Assert.assertTrue(emptyCollection1.containsAll(new BooleanArrayList()));
Assert.assertFalse(emptyCollection1.containsAll(BooleanArrayList.newListWith(true)));
Assert.assertFalse(emptyCollection1.containsAll(BooleanArrayList.newListWith(false)));
MutableBooleanCollection collection = this.classUnderTest();
Assert.assertTrue(collection.containsAll(new BooleanArrayList()));
Assert.assertTrue(collection.containsAll(BooleanArrayList.newListWith(true)));
Assert.assertTrue(collection.containsAll(BooleanArrayList.newListWith(false)));
Assert.assertTrue(collection.containsAll(BooleanArrayList.newListWith(false, true)));
}
Aggregations