@Test
public void testGetMemoryChunkList() throws IOException {

  String value = RandomStringUtils.randomAlphanumeric(10000);
  outputStream.write(value.getBytes());
  byte[] totalOutput = outputStream.toByteArray();
  List<MemoryChunk> chunkList = outputStream.getMemoryChunkList();
  int offset = 0;
  int byteToRead;
  for (final MemoryChunk temp : chunkList) {
    byteToRead = temp.getBuffer().remaining();
    byte[] output = new byte[byteToRead];
    temp.getBuffer().get(output, 0, byteToRead);
    byte[] expected = Arrays.copyOfRange(totalOutput, offset, offset+byteToRead);
    assertEquals(new String(expected), new String(output));
    offset += byteToRead;
  }
}