UnsyncStringWriter extends Writer { public void reset() { if (_stringBundler != null) { _stringBundler.setIndex(0); } else { _stringBuilder.setLength(0); } } UnsyncStringWriter();  UnsyncStringWriter(boolean useStringBundler);  UnsyncStringWriter(boolean useStringBundler, int initialCapacity);  UnsyncStringWriter(int initialCapacity); @Override UnsyncStringWriter append(char c); @Override UnsyncStringWriter append(CharSequence charSequence); @Override UnsyncStringWriter append(
		CharSequence charSequence, int start, int end); @Override void close(); @Override void flush(); StringBuilder getStringBuilder(); StringBundler getStringBundler(); void reset(); @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);  }
@Test public void testReset() throws Exception { UnsyncStringWriter unsyncStringWriter = new UnsyncStringWriter(false); StringBuilder stringBuilder = (StringBuilder)_stringBuilderField.get( unsyncStringWriter); unsyncStringWriter.write("test1"); Assert.assertEquals(5, stringBuilder.length()); unsyncStringWriter.reset(); Assert.assertEquals(0, stringBuilder.length()); unsyncStringWriter = new UnsyncStringWriter(); StringBundler stringBundler = (StringBundler)_stringBundlerField.get( unsyncStringWriter); unsyncStringWriter.write("test1"); Assert.assertEquals(1, stringBundler.index()); unsyncStringWriter.reset(); Assert.assertEquals(0, stringBundler.index()); }