use of org.eclipse.collections.api.list.primitive.MutableBooleanList in project eclipse-collections by eclipse.
the class AbstractBooleanListTestCase method toReversed.
@Test
public void toReversed() {
Assert.assertEquals(BooleanArrayList.newListWith(true, true, false, false), this.newWith(false, false, true, true).toReversed());
MutableBooleanList originalList = this.newWith(true, true, false, false);
Assert.assertNotSame(originalList, originalList.toReversed());
}
use of org.eclipse.collections.api.list.primitive.MutableBooleanList in project eclipse-collections by eclipse.
the class AbstractBooleanListTestCase method injectIntoWithIndex.
@Test
public void injectIntoWithIndex() {
MutableBooleanList list = this.newWith(true, false, true);
MutableInteger result = list.injectIntoWithIndex(new MutableInteger(0), (object, value, index) -> object.add((value ? 1 : 0) + index));
Assert.assertEquals(new MutableInteger(5), result);
}
use of org.eclipse.collections.api.list.primitive.MutableBooleanList in project eclipse-collections by eclipse.
the class AbstractBooleanListTestCase method remove.
@Override
@Test
public void remove() {
super.remove();
Assert.assertFalse(this.newWith(true, true).remove(false));
MutableBooleanList list = this.classUnderTest();
Assert.assertTrue(list.remove(true));
Assert.assertEquals(BooleanArrayList.newListWith(false, true), list);
}
use of org.eclipse.collections.api.list.primitive.MutableBooleanList in project eclipse-collections by eclipse.
the class AbstractBooleanListTestCase method addAllArray.
@Override
@Test
public void addAllArray() {
super.addAllArray();
MutableBooleanList list = this.classUnderTest();
Assert.assertFalse(list.addAllAtIndex(1));
Assert.assertTrue(list.addAll(false, true, false));
Assert.assertTrue(list.addAllAtIndex(4, true, true));
Assert.assertEquals(BooleanArrayList.newListWith(true, false, true, false, true, true, true, false), list);
}
use of org.eclipse.collections.api.list.primitive.MutableBooleanList in project eclipse-collections by eclipse.
the class AbstractBooleanListTestCase method addAllIterable.
@Override
@Test
public void addAllIterable() {
super.addAllIterable();
MutableBooleanList list = this.classUnderTest();
Assert.assertFalse(list.addAllAtIndex(1, new BooleanArrayList()));
Assert.assertTrue(list.addAll(BooleanArrayList.newListWith(false, true, false)));
Assert.assertTrue(list.addAllAtIndex(4, BooleanArrayList.newListWith(true, true)));
Assert.assertEquals(BooleanArrayList.newListWith(true, false, true, false, true, true, true, false), list);
}
Aggregations