@Test
public void testPrintf() {

	StringWriter stringWriter = new StringWriter();
	UnsyncPrintWriter unsyncPrintWriter = new UnsyncPrintWriter(
		stringWriter);
	unsyncPrintWriter.printf("%2$2d %1$2s", "a", 1);
	Assert.assertEquals(" 1  a", stringWriter.toString());
	StringBuffer stringBuffer = stringWriter.getBuffer();
	stringBuffer.setLength(0);
	unsyncPrintWriter.printf("%1$s", "reuse formatter");
	Assert.assertEquals("reuse formatter", stringWriter.toString());
	stringBuffer.setLength(0);
	unsyncPrintWriter.printf(Locale.CANADA, "%1$s", "replace formatter");
	Assert.assertEquals("replace formatter", stringWriter.toString());
	unsyncPrintWriter.close();
	unsyncPrintWriter.printf(Locale.getDefault(), null);
	Assert.assertTrue(unsyncPrintWriter.checkError());
}