use of org.eclipse.collections.api.list.primitive.MutableBooleanList in project eclipse-collections by eclipse.
the class AbstractListTestCase method collectBoolean.
@Override
public void collectBoolean() {
super.collectBoolean();
MutableBooleanList result = this.newWith(-1, 0, 1, 4).collectBoolean(PrimitiveFunctions.integerIsPositive());
Assert.assertEquals(BooleanLists.mutable.of(false, false, true, true), result);
}
use of org.eclipse.collections.api.list.primitive.MutableBooleanList in project eclipse-collections by eclipse.
the class AbstractBooleanListTestCase method indexOf.
@Test
public void indexOf() {
MutableBooleanList arrayList = this.newWith(true, false, true);
Assert.assertEquals(0L, arrayList.indexOf(true));
Assert.assertEquals(1L, arrayList.indexOf(false));
Assert.assertEquals(-1L, this.newWith(false, false).indexOf(true));
MutableBooleanList emptyList = this.newWith();
Assert.assertEquals(-1L, emptyList.indexOf(true));
Assert.assertEquals(-1L, emptyList.indexOf(false));
}
use of org.eclipse.collections.api.list.primitive.MutableBooleanList in project eclipse-collections by eclipse.
the class AbstractBooleanListTestCase method get.
@Test
public void get() {
MutableBooleanList list = this.classUnderTest();
Assert.assertTrue(list.get(0));
Assert.assertFalse(list.get(1));
Assert.assertTrue(list.get(2));
}
use of org.eclipse.collections.api.list.primitive.MutableBooleanList in project eclipse-collections by eclipse.
the class AbstractBooleanListTestCase method addAtIndex.
@Test
public void addAtIndex() {
MutableBooleanList emptyList = this.newWith();
emptyList.addAtIndex(0, false);
Assert.assertEquals(BooleanArrayList.newListWith(false), emptyList);
MutableBooleanList list = this.classUnderTest();
list.addAtIndex(3, true);
Assert.assertEquals(BooleanArrayList.newListWith(true, false, true, true), list);
list.addAtIndex(2, false);
Assert.assertEquals(BooleanArrayList.newListWith(true, false, false, true, true), list);
}
use of org.eclipse.collections.api.list.primitive.MutableBooleanList in project eclipse-collections by eclipse.
the class AbstractBooleanListTestCase method getFirst.
@Test
public void getFirst() {
MutableBooleanList singleItemList = this.newWith(true);
Assert.assertTrue(singleItemList.getFirst());
Assert.assertTrue(this.classUnderTest().getFirst());
}
Aggregations