public static ArrayList<byte[]> copyToNewArrays(Collection<ByteRange> ranges) {
    if (ranges == null) {
      return new ArrayList<>(0);
    }
    ArrayList<byte[]> arrays = Lists.newArrayListWithCapacity(ranges.size());
    for (ByteRange range : ranges) {
      arrays.add(range.deepCopyToNewArray());
    }
    return arrays;
  }
Utility methods for working with {@link ByteRange}.
hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteRangeUtils.java