static L chunks(long end, long chunkSize) { ret chunks(0, end, chunkSize); } static L chunks(long start, long end, long chunkSize) { new L l; int i = start; while (i < total) { l.add(LongRange(i, min(total, i+chunkSize))); i += chunkSize; } ret l; }