@Test
public void testWrite_MixedSequence_Thrash() throws IOException {

  // Write uncompressed data, compressed data, uncompressed data, compressed data (new params)
  // Thrash by writing one byte at a time to pound on edge-casey code
  stream =
      new PartiallyCompressingOutputStream(
          Arrays.asList(COMPRESS_RANGE_1, COMPRESS_RANGE_2), outBuffer, 32768);
  byte[] input =
      fuse(
          PREAMBLE_BYTES,
          ENTRY1.getUncompressedBinaryContent(),
          GAP1_BYTES,
          ENTRY2.getUncompressedBinaryContent());
  byte[] expected =
      fuse(
          PREAMBLE_BYTES,
          ENTRY1.getCompressedBinaryContent(),
          GAP1_BYTES,
          ENTRY2.getCompressedBinaryContent());
  for (int x = 0; x < input.length; x++) {
    stream.write(input[x] & 0xff);
    stream.flush();
  }
  stream.close();
  Assert.assertArrayEquals(expected, outBuffer.toByteArray());
}