@Test
  public void testNewCompositeOutputStreamWithOneStream() throws IOException {
    final OutputStream mockStreamOne = mock(OutputStream.class, "streamOne");
    final CompositeOutputStream compositeOutputStream = new CompositeOutputStream(mockStreamOne);
    assertThat(compositeOutputStream.isEmpty()).isFalse();
    assertThat(compositeOutputStream.size()).isEqualTo(1);
    compositeOutputStream.write(new byte[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, 2, 3);
    compositeOutputStream.write(new byte[] {0, 1});
    compositeOutputStream.write(9);
    compositeOutputStream.flush();
    compositeOutputStream.close();

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

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