### Question:
ListOfBytesOutputStream extends OutputStream { public synchronized void reset() { myCount = 0; }  @Override void close(); int getChunkSize(); synchronized void reset(); synchronized int size(); synchronized List<byte[]> toArrays(); @Override void write(byte[] b); @Override synchronized void write(byte[] b, int off, int len); @Override void write(int b);  }### Answer:
@Test public void testReset() throws IOException { try (ListOfBytesOutputStream out = new ListOfBytesOutputStream()) { out.write(0); out.write(1); out.write(2); List<byte[]> bytes = out.toArrays(); assertEquals(1, bytes.size()); byte[] actual = bytes.get(0); assertEquals(3, out.size()); assertEquals(3, actual.length); assertEquals(0, actual[0]); assertEquals(1, actual[1]); assertEquals(2, actual[2]); out.reset(); out.write(3); out.write(4); out.write(5); bytes = out.toArrays(); assertEquals(1, bytes.size()); actual = bytes.get(0); assertEquals(3, out.size()); assertEquals(3, actual.length); assertEquals(3, actual[0]); assertEquals(4, actual[1]); assertEquals(5, actual[2]); } }