use of org.eclipse.collections.api.list.primitive.MutableBooleanList in project eclipse-collections by eclipse.
the class AbstractMutableBooleanBagTestCase method toList.
@Override
@Test
public void toList() {
super.toList();
MutableBooleanList list = this.newWith(false, false, true).toList();
Assert.assertTrue(list.equals(BooleanArrayList.newListWith(false, false, true)) || list.equals(BooleanArrayList.newListWith(true, false, false)) || list.equals(BooleanArrayList.newListWith(false, true, false)));
}
use of org.eclipse.collections.api.list.primitive.MutableBooleanList in project eclipse-collections by eclipse.
the class ArrayIterateTest method collectBooleanWithTarget.
@Test
public void collectBooleanWithTarget() {
Integer[] objectArray = { -1, 0, 42 };
BooleanArrayList target = new BooleanArrayList();
MutableBooleanList result = ArrayIterate.collectBoolean(objectArray, PrimitiveFunctions.integerIsPositive(), target);
Assert.assertEquals(this.getExpectedBooleanResults(), result);
Assert.assertSame("Target List not returned as result", target, result);
}
use of org.eclipse.collections.api.list.primitive.MutableBooleanList in project eclipse-collections by eclipse.
the class ArrayListIterateTest method collectBoolean.
@Test
public void collectBoolean() {
ArrayList<Integer> list = this.createIntegerList();
MutableBooleanList actual = ArrayListIterate.collectBoolean(list, PrimitiveFunctions.integerIsPositive());
Assert.assertEquals(BooleanArrayList.newListWith(false, false, true), actual);
}
use of org.eclipse.collections.api.list.primitive.MutableBooleanList in project eclipse-collections by eclipse.
the class BooleanArrayStack method pop.
@Override
public BooleanList pop(int count) {
this.checkPositiveValueForCount(count);
this.checkSizeLessThanCount(count);
if (count == 0) {
return new BooleanArrayList(0);
}
MutableBooleanList subList = new BooleanArrayList(count);
while (count > 0) {
subList.add(this.pop());
count--;
}
return subList;
}
use of org.eclipse.collections.api.list.primitive.MutableBooleanList in project eclipse-collections by eclipse.
the class UnmodifiableBooleanListTest method removeAtIndex_throws_index_greater_than_size.
@Override
@Test(expected = UnsupportedOperationException.class)
public void removeAtIndex_throws_index_greater_than_size() {
MutableBooleanList emptyList = new UnmodifiableBooleanList(new BooleanArrayList());
emptyList.removeAtIndex(1);
}
Aggregations