code: public static <T> Stream<T> stream(Spliterator<T> spliterator, boolean parallel) {
          Objects.requireNonNull(spliterator);
          return new ReferencePipeline.Head<>(spliterator,
                                              StreamOpFlag.fromCharacteristics(spliterator),
                                              parallel);
      }
docs: Creates a new sequential or parallel {@code Stream} from a
  {@code Spliterator}.
  
  <p>The spliterator is only traversed, split, or queried for estimated
  size after the terminal operation of the stream pipeline commences.
  
  <p>It is strongly recommended the spliterator report a characteristic of
  {@code IMMUTABLE} or {@code CONCURRENT}, or be
  <a href="../Spliterator.html#binding">late-binding</a>.  Otherwise,
  {@link #stream(java.util.function.Supplier, int, boolean)} should be used
  to reduce the scope of potential interference with the source.  See
  <a href="package-summary.html#NonInterference">Non-Interference</a> for
  more details.
  
  @param <T> the type of stream elements
  @param spliterator a {@code Spliterator} describing the stream elements
  @param parallel if {@code true} then the returned stream is a parallel
  stream; if {@code false} the returned stream is a sequential
  stream.
  @return a new sequential or parallel {@code Stream}