@Override
  // Exposes internal mutable reference by design - Spotbugs is right to warn that this is dangerous
  public synchronized byte[] toByteArray() {
    // Note: count == buf.length is not a correct criteria to "return buf;", because the internal
    // buf may be reused after reset().
    if (!isFallback && count > 0) {
      return buf;
    } else {
      return super.toByteArray();
    }
  }
@Test
  public void testWriteArrayFastAfterReset2() throws IOException {
    resetBoth();
    writeToBothFast(TEST_DATA);
    assertStreamContentsEquals(stream, exposedStream);
    assertSame(TEST_DATA, exposedStream.toByteArray());
  }