@Test
public void testCloseWithException() throws IOException {

	IOException ioException1 = new IOException();
	AtomicBoolean closeCalled = new AtomicBoolean();
	UnsyncFilterOutputStream unsyncFilterOutputStream =
		new UnsyncFilterOutputStream(
			new TestOutputStream() {
				@Override
				public void close() {
					closeCalled.set(true);
				}
				@Override
				public void flush() throws IOException {
					throw ioException1;
				}
			});
	try {
		unsyncFilterOutputStream.close();
		Assert.fail();
	}
	catch (IOException ioException2) {
		Assert.assertSame(ioException1, ioException2);
	}
	Assert.assertTrue(closeCalled.get());
}