### Question:
DataOutputAsStreamDelegate extends DataOutputAsStream { @Override public void write(int b) throws IOException { delegate.write(b); } DataOutputAsStreamDelegate(DataOutput dataOutput); void setDelegate(DataOutput delegate); @Override void write(int b); @Override void write(@NotNull byte[] b); @Override void write(@NotNull byte[] b, int off, int len);  }### Answer:
@Test public void writeIntDelegates() throws IOException { DataOutput dataOutput1 = mock(DataOutput.class); DataOutputAsStreamDelegate dataOutputDelegate = new DataOutputAsStreamDelegate(dataOutput1); dataOutputDelegate.write(1); verify(dataOutput1).write(1); }
@Test public void writeBytesDelegate() throws IOException { DataOutput dataOutput1 = mock(DataOutput.class); DataOutputAsStreamDelegate dataOutputDelegate = new DataOutputAsStreamDelegate(dataOutput1); byte[] bytes = {1}; dataOutputDelegate.write(bytes); verify(dataOutput1).write(bytes); }
@Test public void writeBytesWithOffsetDelegates() throws IOException { DataOutput dataOutput1 = mock(DataOutput.class); DataOutputAsStreamDelegate dataOutputDelegate = new DataOutputAsStreamDelegate(dataOutput1); byte[] bytes = {1}; dataOutputDelegate.write(bytes, 2, bytes.length); verify(dataOutput1).write(bytes, 2, bytes.length); }