code: public static <T> OutputPortCloseable<T> sort(
              OutputPort<T> initialSource,
              Comparator<T> comparator,
              int chunkSize,
              Class<T> clazz,
              File tempFile) throws IOException {
          return sort(initialSource, comparator, chunkSize,
                  new ObjectSerializer.PrimitivIOObjectSerializer<>(clazz), tempFile);
      }
docs: Sort objects supporting PrimitivIO serialization.