code: @NotNull
      public Stream<T> sorted(@Nullable final Comparator<? super T> comparator) {
          return new Stream<T>(params, new ObjSorted<T>(iterator, comparator));
      }
docs: Returns {@code Stream} with sorted elements (as determinated by provided {@code Comparator}).
  
  <p>This is a stateful intermediate operation.
  
  <p>Example:
  <pre>
  comparator: (a, b) -&gt; -a.compareTo(b)
  stream: [1, 2, 3, 4]
  result: [4, 3, 2, 1]
  </pre>
  
  @param comparator  the {@code Comparator} to compare elements
  @return the new stream