}
final String STR = sb.toString();
final String EXP = "a" + STR + "c";
// ok: first test with String:
TextBuffer tb = new TextBuffer(new BufferRecycler());
tb.append('a');
tb.append(STR, 0, len);
tb.append('c');
assertEquals(len+2, tb.size());
assertEquals(EXP, tb.contentsAsString());
// then char[]
tb = new TextBuffer(new BufferRecycler());
tb.append('a');
tb.append(STR.toCharArray(), 0, len);
tb.append('c');
assertEquals(len+2, tb.size());
assertEquals(EXP, tb.contentsAsString());