use of org.eclipse.collections.api.list.primitive.ImmutableBooleanList in project eclipse-collections by eclipse.
the class AbstractImmutableBooleanListTestCase method indexOf.
@Test
public void indexOf() {
ImmutableBooleanList list = this.classUnderTest();
Assert.assertEquals(0L, list.indexOf(true));
Assert.assertEquals(list.size() > 2 ? 1L : -1L, list.indexOf(false));
MutableBooleanList mutableList = this.newMutableCollectionWith();
for (int i = 0; i < list.size(); i++) {
mutableList.add(false);
}
Assert.assertEquals(-1L, mutableList.toImmutable().indexOf(true));
}
use of org.eclipse.collections.api.list.primitive.ImmutableBooleanList in project eclipse-collections by eclipse.
the class ImmutableBooleanEmptyListTest method newWithout.
@Override
@Test
public void newWithout() {
ImmutableBooleanList emptyList = this.newWith();
ImmutableBooleanList newList = emptyList.newWithout(true);
Assert.assertEquals(this.newWith(), newList);
Assert.assertSame(emptyList, newList);
Assert.assertEquals(this.newMutableCollectionWith(), emptyList);
}
use of org.eclipse.collections.api.list.primitive.ImmutableBooleanList in project eclipse-collections by eclipse.
the class AbstractBooleanListTestCase method toImmutable.
@Test
public void toImmutable() {
ImmutableBooleanList immutable = this.classUnderTest().toImmutable();
Assert.assertEquals(BooleanArrayList.newListWith(true, false, true), immutable);
}
Aggregations