コード例 #1
0
  @Test
  public void appendString() {
    Appendable builder1 = new StringBuilder();
    this.classUnderTest().appendString(builder1);
    Assert.assertEquals(
        FastList.newList(this.classUnderTest()).toString(), '[' + builder1.toString() + ']');

    Appendable builder2 = new StringBuilder();
    this.classUnderTest().appendString(builder2, ", ");
    Assert.assertEquals(
        FastList.newList(this.classUnderTest()).toString(), '[' + builder2.toString() + ']');

    Appendable builder3 = new StringBuilder();
    this.classUnderTest().appendString(builder3, "[", ", ", "]");
    Assert.assertEquals(FastList.newList(this.classUnderTest()).toString(), builder3.toString());
  }
コード例 #2
0
 @Test
 public void appendString() {
   Appendable builder = new StringBuilder();
   this.newWith(1, 2, 3).appendString(builder);
   Assert.assertEquals("1, 2, 3", builder.toString());
 }