@Test
public void testTwoChunksWrite() throws IOException {

    int size = ChunkedOutputStream.MAX_ARRAY_SIZE + 1;
    for (int i = 0; i < size; ++i) {
        stream.write(i);
    }
    int counter = 0;
    for (byte[] chunk: assertFinishedStream(size, 2)) {
        for (byte actual: chunk) {
            assertEquals((byte) counter++, actual);
        }
    }
}