@Test
  public void testMockOutputStream() throws IOException {
    final OutputStream mockOutputStream = mock(OutputStream.class, "OutputStream");
    mockOutputStream.write(new byte[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, 2, 3);
    mockOutputStream.write(new byte[] {0, 1});
    mockOutputStream.write(9);
    mockOutputStream.flush();
    mockOutputStream.close();

    verify(mockOutputStream, times(1)).write(new byte[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, 2, 3);
    verify(mockOutputStream, times(1)).write(new byte[] {0, 1});
    verify(mockOutputStream, times(1)).write(9);
    verify(mockOutputStream, times(1)).flush();
    verify(mockOutputStream, times(1)).close();
  }
Unit tests for CompositeOutputStream.

@since GemFire 7.0
geode-core/src/test/java/org/apache/geode/internal/io/CompositeOutputStreamJUnitTest.java