Exemplo n.º 1
0
 @Test
 public void makeString() {
   ImmutableBag<String> bag = this.newBag();
   Assert.assertEquals(FastList.newList(bag).makeString(), bag.makeString());
   Assert.assertEquals(bag.toString(), '[' + bag.makeString() + ']');
   Assert.assertEquals(bag.toString(), '[' + bag.makeString(", ") + ']');
   Assert.assertEquals(bag.toString(), bag.makeString("[", ", ", "]"));
 }
Exemplo n.º 2
0
  @Test
  public void appendString_with_start_separator_end() {
    ImmutableBag<String> bag = this.newBag();

    Appendable builder = new StringBuilder();
    bag.appendString(builder, "[", ", ", "]");
    Assert.assertEquals(bag.toString(), builder.toString());
  }
Exemplo n.º 3
0
  @Test
  public void appendString_with_separator() {
    ImmutableBag<String> bag = this.newBag();

    Appendable builder = new StringBuilder();
    bag.appendString(builder, ", ");
    Assert.assertEquals(bag.toString(), '[' + builder.toString() + ']');
  }