code: public static <E> Stream<Map.Entry<E, E>> crossProduct(Stream<E> stream) {
          Objects.requireNonNull(stream);
  
          CrossProductOrderedSpliterator<E> spliterator =
                  CrossProductOrderedSpliterator.of(stream.spliterator());
  
          return StreamSupport.stream(spliterator, stream.isParallel()).onClose(stream::close);
      }
docs: <p>Generates a stream of <code>Map.Entry&lt;E, E&gt;</code> elements with all the cartesian product of the
  elements of the provided stream with itself. </p>
  <p>For a stream <code>{a, b, c}</code>, a stream with the following elements is created:
  <code>{(a, a), (a, b), (a, c), (b, a), (b, b), (b, c), (c, a), (c, b), (c, c)}</code>, where
  <code>(a, b)</code> is the <code>Map.Entry</code> with key <code>a</code> and value <code>b</code>.</p>
  <p>A <code>NullPointerException</code> will be thrown if the provided stream is null.</p>
  
  @param stream the processed stream
  @param <E>    the type of the provided stream
  @return a stream of the cartesian product