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

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

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