@Test
public void testCloseWithTwoExceptions() throws IOException {

	IOException ioException1 = new IOException();
	IOException ioException2 = new IOException();
	UnsyncFilterOutputStream unsyncFilterOutputStream =
		new UnsyncFilterOutputStream(
			new TestOutputStream() {
				@Override
				public void close() throws IOException {
					throw ioException2;
				}
				@Override
				public void flush() throws IOException {
					throw ioException1;
				}
			});
	try {
		unsyncFilterOutputStream.close();
		Assert.fail();
	}
	catch (IOException ioException3) {
		Assert.assertSame(ioException1, ioException3);
		Throwable[] throwables = ioException1.getSuppressed();
		Assert.assertEquals(
			Arrays.toString(throwables), 1, throwables.length);
		Assert.assertSame(ioException2, throwables[0]);
	}
}