code: public List<File> writeSortedChunks(Iterator<T> input) throws IOException {
          List<File> result = new ArrayList<File>();
          while (input.hasNext()) {
              File chunkFile = writeSortedChunk(input);
              result.add(chunkFile);
          }
          if (debugMerge) {
              System.out.printf("Chunks %d (chunkSize=%d, maxOpenFiles=%d)\n", result.size(), config.chunkSize, config.maxOpenFiles);
          }
          return result;
      }
docs: Read the data from the iterator, then perform a sort, and write individually
  sorted chunk files to disk.
  @param input Iterator containing the data to sort.
  @return list of sorted chunk files.
  @throws IOException if something fails when doing I/O.