### Question:
OutputStreamDelegate extends OutputStream { @Override public void write(int b) throws IOException { delegate.write(b); } OutputStreamDelegate(OutputStream outputStream); void setDelegate(OutputStream delegate); @Override void write(int b); @Override void write(@NotNull byte[] b); @Override void write(@NotNull byte[] b, int off, int len); @Override void close();  }### Answer:
@Test public void writeIntDelegates() throws IOException { OutputStream os1 = mock(OutputStream.class); OutputStreamDelegate outputStreamDelegate = new OutputStreamDelegate(os1); outputStreamDelegate.write(1); verify(os1).write(1); }
@Test public void writeBytesDelegate() throws IOException { OutputStream os1 = mock(OutputStream.class); OutputStreamDelegate outputStreamDelegate = new OutputStreamDelegate(os1); byte[] bytes = {1}; outputStreamDelegate.write(bytes); verify(os1).write(bytes); }
@Test public void writeBytesWithOffsetDelegates() throws IOException { OutputStream os1 = mock(OutputStream.class); OutputStreamDelegate outputStreamDelegate = new OutputStreamDelegate(os1); byte[] bytes = {1}; outputStreamDelegate.write(bytes, 2, bytes.length); verify(os1).write(bytes, 2, bytes.length); }