use of org.eclipse.collections.api.list.primitive.MutableBooleanList in project eclipse-collections by eclipse.
the class AbstractBooleanListTestCase method set.
@Test
public void set() {
MutableBooleanList list = this.classUnderTest();
list.set(1, false);
Assert.assertEquals(BooleanArrayList.newListWith(true, false, true), list);
list.set(1, true);
Assert.assertEquals(BooleanArrayList.newListWith(true, true, true), list);
}
use of org.eclipse.collections.api.list.primitive.MutableBooleanList in project eclipse-collections by eclipse.
the class AbstractBooleanListTestCase method testEquals.
@Override
@Test
public void testEquals() {
super.testEquals();
MutableBooleanList list1 = this.newWith(true, false, true, true);
MutableBooleanList list2 = this.newWith(true, true, false, true);
Assert.assertNotEquals(list1, list2);
}
use of org.eclipse.collections.api.list.primitive.MutableBooleanList in project eclipse-collections by eclipse.
the class AbstractBooleanListTestCase method toArray.
@Override
@Test
public void toArray() {
super.toArray();
MutableBooleanList list = this.classUnderTest();
Assert.assertEquals(3L, (long) list.toArray().length);
Assert.assertTrue(list.toArray()[0]);
Assert.assertFalse(list.toArray()[1]);
Assert.assertTrue(list.toArray()[2]);
}
use of org.eclipse.collections.api.list.primitive.MutableBooleanList in project eclipse-collections by eclipse.
the class AbstractBooleanListTestCase method getLast.
@Test
public void getLast() {
MutableBooleanList singleItemList = this.newWith(true);
Assert.assertTrue(singleItemList.getLast());
Assert.assertTrue(this.classUnderTest().getLast());
Assert.assertFalse(this.newWith(true, true, false).getLast());
}
use of org.eclipse.collections.api.list.primitive.MutableBooleanList in project eclipse-collections by eclipse.
the class AbstractBooleanListTestCase method reverseThis.
@Test
public void reverseThis() {
Assert.assertEquals(BooleanArrayList.newListWith(true, true, false, false), this.newWith(false, false, true, true).reverseThis());
MutableBooleanList originalList = this.newWith(true, true, false, false);
Assert.assertSame(originalList, originalList.reverseThis());
MutableBooleanList originalList2 = this.newWith(true, false, false);
originalList2.removeAtIndex(2);
Assert.assertEquals(originalList2, BooleanArrayList.newListWith(true, false));
Assert.assertEquals(originalList2.reverseThis(), BooleanArrayList.newListWith(false, true));
}
Aggregations