public static List<ByteBuffer> cloneByteBufferList(List<ByteBuffer> source) {
    List<ByteBuffer> ret = new ArrayList<>(source.size());
    for (ByteBuffer b : source) {
      ret.add(cloneByteBuffer(b));
    }
    return ret;
  }
@Test
  public void cloneByteBufferList() {
    final int bufferSize = 10;
    final int listLength = 10;
    ArrayList<ByteBuffer> bufList = new ArrayList<>(listLength);
    for (int k = 0; k < listLength; k++) {
      ByteBuffer buf = ByteBuffer.allocate(bufferSize);
      for (byte i = 0; i < bufferSize; i++) {
        buf.put((byte) (i + k));
      }
      bufList.add(buf);
    }
    List<ByteBuffer> bufListClone = BufferUtils.cloneByteBufferList(bufList);
    assertEquals(listLength, bufListClone.size());
    for (int k = 0; k < listLength; k++) {
      assertEquals(bufList.get(k), bufListClone.get(k));
    }
  }