use of org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList in project eclipse-collections by eclipse.
the class ImmutableBooleanHashSetTest method toList.
@Override
@Test
public void toList() {
super.toList();
Assert.assertEquals(new BooleanArrayList(), this.emptySet.toList());
Assert.assertEquals(BooleanArrayList.newListWith(false), this.falseSet.toList());
Assert.assertEquals(BooleanArrayList.newListWith(true), this.trueSet.toList());
Assert.assertTrue(BooleanArrayList.newListWith(false, true).equals(this.trueFalseSet.toList()) || BooleanArrayList.newListWith(true, false).equals(this.trueFalseSet.toList()));
}
use of org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList in project eclipse-collections by eclipse.
the class ImmutableEmptySortedBagTest method collectBoolean.
@Override
@Test
public void collectBoolean() {
ImmutableSortedBag<Integer> bag = this.classUnderTest();
Assert.assertEquals(new BooleanArrayList(), bag.collectBoolean(each -> false));
}
use of org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList in project eclipse-collections by eclipse.
the class AbstractBooleanIterableTestCase method containsAllIterable.
@Test
public void containsAllIterable() {
BooleanIterable emptyCollection = this.newWith();
Assert.assertTrue(emptyCollection.containsAll(new BooleanArrayList()));
Assert.assertFalse(emptyCollection.containsAll(BooleanArrayList.newListWith(true)));
Assert.assertFalse(emptyCollection.containsAll(BooleanArrayList.newListWith(false)));
BooleanIterable booleanIterable = this.classUnderTest();
int size = booleanIterable.size();
Assert.assertTrue(booleanIterable.containsAll(new BooleanArrayList()));
Assert.assertEquals(size >= 1, booleanIterable.containsAll(BooleanArrayList.newListWith(true)));
Assert.assertEquals(size >= 2, booleanIterable.containsAll(BooleanArrayList.newListWith(false)));
Assert.assertEquals(size >= 2, booleanIterable.containsAll(BooleanArrayList.newListWith(true, false)));
BooleanIterable iterable = this.newWith(true, true, false, false, false);
Assert.assertTrue(iterable.containsAll(BooleanArrayList.newListWith(true)));
Assert.assertTrue(iterable.containsAll(BooleanArrayList.newListWith(false)));
Assert.assertTrue(iterable.containsAll(BooleanArrayList.newListWith(true, false)));
Assert.assertTrue(iterable.containsAll(BooleanArrayList.newListWith(true, true)));
Assert.assertTrue(iterable.containsAll(BooleanArrayList.newListWith(false, false)));
Assert.assertTrue(iterable.containsAll(BooleanArrayList.newListWith(true, false, true)));
Assert.assertFalse(this.newWith(true, true).containsAll(BooleanArrayList.newListWith(false, true, false)));
BooleanIterable trueCollection = this.newWith(true, true, true, true);
Assert.assertFalse(trueCollection.containsAll(BooleanArrayList.newListWith(true, false)));
BooleanIterable falseCollection = this.newWith(false, false, false, false);
Assert.assertFalse(falseCollection.containsAll(BooleanArrayList.newListWith(true, false)));
}
use of org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList 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.impl.list.mutable.primitive.BooleanArrayList 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