use of org.eclipse.collections.api.BooleanIterable 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.api.BooleanIterable 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.api.BooleanIterable 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.api.BooleanIterable 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());
}
use of org.eclipse.collections.api.BooleanIterable in project eclipse-collections by eclipse.
the class ReverseBooleanIterableTest method containsAll.
@Test
public void containsAll() {
BooleanIterable iterable = BooleanArrayList.newListWith(true, false, true).asReversed();
Assert.assertTrue(iterable.containsAll(true));
Assert.assertTrue(iterable.containsAll(true, false));
Assert.assertFalse(BooleanArrayList.newListWith(false, false).asReversed().containsAll(true));
Assert.assertFalse(BooleanArrayList.newListWith(false, false).asReversed().containsAll(BooleanArrayList.newListWith(true, false)));
Assert.assertTrue(BooleanArrayList.newListWith(false, false, true).asReversed().containsAll(BooleanArrayList.newListWith(true, false)));
}
Aggregations