### Question:
WrappedOutputStream extends FilterOutputStream { @Override public void write (@Nonnull final byte [] aBuf, final int nOfs, final int nLen) throws IOException { ValueEnforcer.isArrayOfsLen (aBuf, nOfs, nLen); out.write (aBuf, nOfs, nLen); } WrappedOutputStream(@Nonnull final OutputStream aWrappedOS); @Nonnull final OutputStream getWrappedOutputStream(); @Override void write(@Nonnull final byte [] aBuf, final int nOfs, final int nLen); @Override String toString();  }### Answer:
@SuppressWarnings ("resource") @Test public void testAll () throws IOException { final NonBlockingByteArrayOutputStream baos = new NonBlockingByteArrayOutputStream (); try (final WrappedOutputStream ws = new WrappedOutputStream (baos)) { ws.write ('a'); ws.write ("bc".getBytes (StandardCharsets.ISO_8859_1)); ws.write ("cde".getBytes (StandardCharsets.ISO_8859_1), 1, 1); ws.flush (); assertEquals ("abcd", baos.getAsString (StandardCharsets.ISO_8859_1)); CommonsTestHelper.testToStringImplementation (ws); } try { new WrappedOutputStream (null).close (); fail (); } catch (final NullPointerException ex) {} }