code: public File writeSortedChunk(Iterator<T> input) throws IOException {
          List<T> chunk = readChunk(input);
          return writeInternalSortedChunk(chunk);
      }
docs: Read the data from the iterator, then perform a sort, and write a single sorted
  chunk file to disk. Note that a maximum of elements equal to the chunk size will
  be read from the iterator, so make sure that the iterator contains no more than
  that. If that is the case then you may want to use the writeSortedChunks method
  instead.
  @param input Iterator containing the data to sort.
  @return chunk file
  @throws IOException if something fails when doing I/O.