Search in sources :

Example 31 with BooleanArrayList

use of org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList in project eclipse-collections by eclipse.

the class BooleanListsTest method newListWithWithList.

@Test
public void newListWithWithList() {
    Assert.assertEquals(new BooleanArrayList(), BooleanLists.immutable.ofAll(new BooleanArrayList()));
    Assert.assertEquals(BooleanArrayList.newListWith(true), BooleanLists.immutable.ofAll(BooleanArrayList.newListWith(true)));
    Assert.assertEquals(BooleanArrayList.newListWith(true, false), BooleanLists.immutable.ofAll(BooleanArrayList.newListWith(true, false)));
    Assert.assertEquals(BooleanArrayList.newListWith(true, false, true), BooleanLists.immutable.ofAll(BooleanArrayList.newListWith(true, false, true)));
}
Also used : BooleanArrayList(org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList) Test(org.junit.Test)

Example 32 with BooleanArrayList

use of org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList in project eclipse-collections by eclipse.

the class ReverseBooleanIterableTest method appendString.

@Test
public void appendString() {
    BooleanIterable iterable = BooleanArrayList.newListWith(false, false, true).asReversed();
    StringBuilder appendable = new StringBuilder();
    new BooleanArrayList().asReversed().appendString(appendable);
    Assert.assertEquals("", appendable.toString());
    StringBuilder appendable2 = new StringBuilder();
    iterable.appendString(appendable2);
    Assert.assertEquals("true, false, false", appendable2.toString());
    StringBuilder appendable3 = new StringBuilder();
    iterable.appendString(appendable3, "/");
    Assert.assertEquals("true/false/false", appendable3.toString());
    StringBuilder appendable4 = new StringBuilder();
    iterable.appendString(appendable4, "[", ", ", "]");
    Assert.assertEquals(iterable.toString(), appendable4.toString());
}
Also used : BooleanIterable(org.eclipse.collections.api.BooleanIterable) BooleanArrayList(org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList) Test(org.junit.Test)

Example 33 with BooleanArrayList

use of org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList in project eclipse-collections by eclipse.

the class ReverseBooleanIterableTest method makeString.

@Test
public void makeString() {
    BooleanIterable iterable = BooleanArrayList.newListWith(false, false, true).asReversed();
    Assert.assertEquals("true, false, false", iterable.makeString());
    Assert.assertEquals("true", BooleanArrayList.newListWith(true).makeString("/"));
    Assert.assertEquals("true/false/false", iterable.makeString("/"));
    Assert.assertEquals(iterable.toString(), iterable.makeString("[", ", ", "]"));
    Assert.assertEquals("", new BooleanArrayList().asReversed().makeString());
}
Also used : BooleanIterable(org.eclipse.collections.api.BooleanIterable) BooleanArrayList(org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList) Test(org.junit.Test)

Example 34 with BooleanArrayList

use of org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList in project eclipse-collections by eclipse.

the class ReverseBooleanIterableTest method size.

@Test
public void size() {
    BooleanIterable iterable = BooleanArrayList.newListWith(false, false, true).asReversed();
    Verify.assertSize(0, new BooleanArrayList().asReversed());
    Verify.assertSize(3, iterable);
}
Also used : BooleanIterable(org.eclipse.collections.api.BooleanIterable) BooleanArrayList(org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList) Test(org.junit.Test)

Example 35 with BooleanArrayList

use of org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList in project eclipse-collections by eclipse.

the class ReverseBooleanIterableTest method testToString.

@Test
public void testToString() {
    BooleanIterable iterable = BooleanArrayList.newListWith(false, false, true).asReversed();
    Assert.assertEquals("[true, false, false]", iterable.toString());
    Assert.assertEquals("[]", new BooleanArrayList().asReversed().toString());
}
Also used : BooleanIterable(org.eclipse.collections.api.BooleanIterable) BooleanArrayList(org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList) Test(org.junit.Test)

Aggregations

BooleanArrayList (org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList)49 Test (org.junit.Test)35 MutableBooleanCollection (org.eclipse.collections.api.collection.primitive.MutableBooleanCollection)11 BooleanIterable (org.eclipse.collections.api.BooleanIterable)7 MutableBooleanList (org.eclipse.collections.api.list.primitive.MutableBooleanList)6 MutableBooleanSet (org.eclipse.collections.api.set.primitive.MutableBooleanSet)3 BooleanHashBag (org.eclipse.collections.impl.bag.mutable.primitive.BooleanHashBag)3 ByteArrayList (org.eclipse.collections.impl.list.mutable.primitive.ByteArrayList)3 CharArrayList (org.eclipse.collections.impl.list.mutable.primitive.CharArrayList)3 DoubleArrayList (org.eclipse.collections.impl.list.mutable.primitive.DoubleArrayList)3 FloatArrayList (org.eclipse.collections.impl.list.mutable.primitive.FloatArrayList)3 IntArrayList (org.eclipse.collections.impl.list.mutable.primitive.IntArrayList)3 LongArrayList (org.eclipse.collections.impl.list.mutable.primitive.LongArrayList)3 ShortArrayList (org.eclipse.collections.impl.list.mutable.primitive.ShortArrayList)3 ArrayList (java.util.ArrayList)2 Collections (java.util.Collections)2 Comparator (java.util.Comparator)2 NoSuchElementException (java.util.NoSuchElementException)2 ImmutableSortedBag (org.eclipse.collections.api.bag.sorted.ImmutableSortedBag)2 MutableCollection (org.eclipse.collections.api.collection.MutableCollection)2