UnsyncCharArrayWriter extends Writer { @Override public String toString() { return new String(_buffer, 0, _index); } UnsyncCharArrayWriter();  UnsyncCharArrayWriter(int initialSize); @Override Writer append(char c); @Override Writer append(CharSequence charSequence); @Override Writer append(CharSequence charSequence, int start, int end); @Override void close(); @Override void flush(); void reset(); int size(); CharBuffer toCharBuffer(); @Override String toString(); @Override void write(char[] chars); @Override void write(char[] chars, int offset, int length); @Override void write(int c); @Override void write(String string); @Override void write(String string, int offset, int length); int writeTo(CharBuffer charBuffer); int writeTo(OutputStream outputStream, String charsetName); int writeTo(Writer writer);  }
@Test public void testToString() { UnsyncCharArrayWriter unsyncCharArrayWriter = new UnsyncCharArrayWriter(); unsyncCharArrayWriter.write("test1"); Assert.assertEquals("test1", unsyncCharArrayWriter.toString()); }