Search in sources :

Example 16 with MutableBooleanList

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);
}
Also used : MutableBooleanList(org.eclipse.collections.api.list.primitive.MutableBooleanList) Test(org.junit.Test)

Example 17 with MutableBooleanList

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);
}
Also used : MutableBooleanList(org.eclipse.collections.api.list.primitive.MutableBooleanList) Test(org.junit.Test)

Example 18 with MutableBooleanList

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]);
}
Also used : MutableBooleanList(org.eclipse.collections.api.list.primitive.MutableBooleanList) Test(org.junit.Test)

Example 19 with MutableBooleanList

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());
}
Also used : MutableBooleanList(org.eclipse.collections.api.list.primitive.MutableBooleanList) Test(org.junit.Test)

Example 20 with MutableBooleanList

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));
}
Also used : MutableBooleanList(org.eclipse.collections.api.list.primitive.MutableBooleanList) Test(org.junit.Test)

Aggregations

MutableBooleanList (org.eclipse.collections.api.list.primitive.MutableBooleanList)44 Test (org.junit.Test)38 BooleanArrayList (org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList)6 ImmutableBooleanCollection (org.eclipse.collections.api.collection.primitive.ImmutableBooleanCollection)4 BooleanIterator (org.eclipse.collections.api.iterator.BooleanIterator)3 BooleanList (org.eclipse.collections.api.list.primitive.BooleanList)3 ImmutableBooleanList (org.eclipse.collections.api.list.primitive.ImmutableBooleanList)3 Verify (org.eclipse.collections.impl.test.Verify)3 Assert (org.junit.Assert)3 ArrayList (java.util.ArrayList)2 BooleanIterable (org.eclipse.collections.api.BooleanIterable)2 LazyBooleanIterable (org.eclipse.collections.api.LazyBooleanIterable)2 BooleanLists (org.eclipse.collections.impl.factory.primitive.BooleanLists)2 ReverseBooleanIterable (org.eclipse.collections.impl.lazy.primitive.ReverseBooleanIterable)2 ByteArrayList (org.eclipse.collections.impl.list.mutable.primitive.ByteArrayList)2 CharArrayList (org.eclipse.collections.impl.list.mutable.primitive.CharArrayList)2 DoubleArrayList (org.eclipse.collections.impl.list.mutable.primitive.DoubleArrayList)2 FloatArrayList (org.eclipse.collections.impl.list.mutable.primitive.FloatArrayList)2 IntArrayList (org.eclipse.collections.impl.list.mutable.primitive.IntArrayList)2 LongArrayList (org.eclipse.collections.impl.list.mutable.primitive.LongArrayList)2