@Test
public void testClose() throws Exception {

	StringWriter stringWriter = new StringWriter();
	UnsyncBufferedWriter unsyncBufferedWriter = new UnsyncBufferedWriter(
		stringWriter, 10);
	Assert.assertNotNull(_bufferField.get(unsyncBufferedWriter));
	Assert.assertSame(stringWriter, _writerField.get(unsyncBufferedWriter));
	unsyncBufferedWriter.write("test");
	unsyncBufferedWriter.close();
	Assert.assertNull(_bufferField.get(unsyncBufferedWriter));
	Assert.assertNull(_writerField.get(unsyncBufferedWriter));
	Assert.assertEquals("test", stringWriter.toString());
	try {
		unsyncBufferedWriter.flush();
		Assert.fail();
	}
	catch (IOException ioException) {
		Assert.assertEquals("Writer is null", ioException.getMessage());
	}
	try {
		unsyncBufferedWriter.write("abc".toCharArray(), 0, 3);
		Assert.fail();
	}
	catch (IOException ioException) {
		Assert.assertEquals("Writer is null", ioException.getMessage());
	}
	try {
		unsyncBufferedWriter.write(1);
		Assert.fail();
	}
	catch (IOException ioException) {
		Assert.assertEquals("Writer is null", ioException.getMessage());
	}
	try {
		unsyncBufferedWriter.write("abc", 0, 3);
		Assert.fail();
	}
	catch (IOException ioException) {
		Assert.assertEquals("Writer is null", ioException.getMessage());
	}
	unsyncBufferedWriter.close();
}