Resue ClosedWriter.CLOSED_WRITER.
MODIFY
src/test/java/org/apache/commons/io/output/TaggedWriterTest.java
src/test/java/org/apache/commons/io/output/TaggedWriterTest.java
@@ -103,8 +103,7 @@ public void testBrokenWriter() {
@Test
public void testOtherException() throws Exception {
final IOException exception = new IOException("test exception");
- try (final Writer closed = new ClosedWriter();
- final TaggedWriter writer = new TaggedWriter(closed)) {
+ try (final TaggedWriter writer = new TaggedWriter(ClosedWriter.CLOSED_WRITER)) {
assertFalse(writer.isCauseOf(exception));
assertFalse(writer.isCauseOf(new TaggedIOException(exception, UUID.randomUUID())));

Resue ClosedWriter.CLOSED_WRITER.