UnsyncPrintWriter extends PrintWriter { @Override public void write(char[] chars) { write(chars, 0, chars.length); } UnsyncPrintWriter(File file);  UnsyncPrintWriter(File file, String csn);  UnsyncPrintWriter(OutputStream outputStream);  UnsyncPrintWriter(String fileName);  UnsyncPrintWriter(String fileName, String csn);  UnsyncPrintWriter(Writer writer); @Override PrintWriter append(char c); @Override PrintWriter append(CharSequence charSequence); @Override PrintWriter append(CharSequence charSequence, int start, int end); @Override boolean checkError(); @Override void close(); @Override void flush(); @Override PrintWriter format(
		Locale locale, String format, Object... arguments); @Override PrintWriter format(String format, Object... arguments); @Override void print(boolean b); @Override void print(char c); @Override void print(char[] chars); @Override void print(double d); @Override void print(float f); @Override void print(int i); @Override void print(long l); @Override void print(Object object); @Override void print(String string); @Override PrintWriter printf(
		Locale locale, String format, Object... arguments); @Override PrintWriter printf(String format, Object... arguments); @Override void println(); @Override void println(boolean b); @Override void println(char c); @Override void println(char[] chars); @Override void println(double d); @Override void println(float f); @Override void println(int i); @Override void println(long l); @Override void println(Object object); @Override void println(String string); void reset(Writer writer); @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 testWrite() { StringWriter stringWriter = new StringWriter(); UnsyncPrintWriter unsyncPrintWriter = new UnsyncPrintWriter( stringWriter); unsyncPrintWriter.write('a'); Assert.assertEquals("a", stringWriter.toString()); unsyncPrintWriter.write('b'); Assert.assertEquals("ab", stringWriter.toString()); unsyncPrintWriter.write(new char[] {'c', 'd'}); Assert.assertEquals("abcd", stringWriter.toString()); unsyncPrintWriter.write(new char[] {'e', 'f'}); Assert.assertEquals("abcdef", stringWriter.toString()); unsyncPrintWriter.write( new char[] {'e', 'f', 'g', 'h', 'i', 'j'}, 2, 2); Assert.assertEquals("abcdefgh", stringWriter.toString()); unsyncPrintWriter.write( new char[] {'g', 'h', 'i', 'j', 'k', 'l'}, 2, 2); Assert.assertEquals("abcdefghij", stringWriter.toString()); unsyncPrintWriter.write("kl"); Assert.assertEquals("abcdefghijkl", stringWriter.toString()); unsyncPrintWriter.write("mn"); Assert.assertEquals("abcdefghijklmn", stringWriter.toString()); unsyncPrintWriter.write("mnopqr", 2, 2); Assert.assertEquals("abcdefghijklmnop", stringWriter.toString()); unsyncPrintWriter.write("opqrst", 2, 2); Assert.assertEquals("abcdefghijklmnopqr", stringWriter.toString()); }