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