@Test
public void testWrite() {

	StringWriter stringWriter = new StringWriter();
	UnsyncPrintWriter unsyncPrintWriter = new UnsyncPrintWriter(
		stringWriter);
	// write(int c)
	unsyncPrintWriter.write('a');
	Assert.assertEquals("a", stringWriter.toString());
	unsyncPrintWriter.write('b');
	Assert.assertEquals("ab", stringWriter.toString());
	// write(char[] chars)
	unsyncPrintWriter.write(new char[] {'c', 'd'});
	Assert.assertEquals("abcd", stringWriter.toString());
	unsyncPrintWriter.write(new char[] {'e', 'f'});
	Assert.assertEquals("abcdef", stringWriter.toString());
	// write(char[] chars, int offset, int length)
	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());
	// write(String string)
	unsyncPrintWriter.write("kl");
	Assert.assertEquals("abcdefghijkl", stringWriter.toString());
	unsyncPrintWriter.write("mn");
	Assert.assertEquals("abcdefghijklmn", stringWriter.toString());
	// write(String string, int offset, int length)
	unsyncPrintWriter.write("mnopqr", 2, 2);
	Assert.assertEquals("abcdefghijklmnop", stringWriter.toString());
	unsyncPrintWriter.write("opqrst", 2, 2);
	Assert.assertEquals("abcdefghijklmnopqr", stringWriter.toString());
}