Resue ClosedOutputStream.CLOSED_OUTPUT_STREAM.
MODIFY
src/test/java/org/apache/commons/io/output/TaggedOutputStreamTest.java
src/test/java/org/apache/commons/io/output/TaggedOutputStreamTest.java
@@ -103,8 +103,7 @@ public void testBrokenStream() {
@Test
public void testOtherException() throws Exception {
final IOException exception = new IOException("test exception");
- try (final OutputStream closed = new ClosedOutputStream();
- final TaggedOutputStream stream = new TaggedOutputStream(closed)) {
+ try (final TaggedOutputStream stream = new TaggedOutputStream(ClosedOutputStream.CLOSED_OUTPUT_STREAM)) {
assertFalse(stream.isCauseOf(exception));
assertFalse(stream.isCauseOf(new TaggedIOException(exception, UUID.randomUUID())));

Resue ClosedOutputStream.CLOSED_OUTPUT_STREAM.