final OutputStream closed = new ClosedOutputStream();
final TaggedOutputStream stream = new TaggedOutputStream(closed);
assertFalse(stream.isCauseOf(exception));
assertFalse(stream.isCauseOf(
new TaggedIOException(exception, UUID.randomUUID())));
try {
stream.throwIfCauseOf(exception);
} catch (final IOException e) {
fail("Unexpected exception thrown");
}
try {
stream.throwIfCauseOf(
new TaggedIOException(exception, UUID.randomUUID()));
} catch (final IOException e) {
fail("Unexpected exception thrown");
}
stream.close();
}