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)));
}
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());
}
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());
}
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);
}
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());
}
Aggregations