@Test
public void testReset() throws Exception {

  ByteArrayOutputStream byteArrayOutputStream1 = new ByteArrayOutputStream(1000);
  ReusableBufferedOutputStream outputStream = new ReusableBufferedOutputStream(
      byteArrayOutputStream1, 1000);
  outputStream.write(TEST_DATA_1);
  outputStream.close();
  ByteArrayOutputStream byteArrayOutputStream2 = new ByteArrayOutputStream(1000);
  outputStream.reset(byteArrayOutputStream2);
  outputStream.write(TEST_DATA_2);
  outputStream.close();
  assertThat(byteArrayOutputStream1.toByteArray()).isEqualTo(TEST_DATA_1);
  assertThat(byteArrayOutputStream2.toByteArray()).isEqualTo(TEST_DATA_2);
}