code: public static <T> StreamEx<List<T>> cartesianPower(int n, Collection<T> source) {
          if (n == 0)
              return StreamEx.of(new ConstSpliterator.OfRef<>(Collections.emptyList(), 1, true));
          return of(new CrossSpliterator.ToList<>(Collections.nCopies(n, source)));
      }
docs: Returns a new {@code StreamEx} which elements are {@link List} objects
  containing all possible n-tuples of the elements of supplied collection.
  The whole stream forms an n-fold Cartesian product of input collection
  with itself or n-ary Cartesian power of the input collection.
  
  <p>
  Every stream element is the {@code List} of the supplied size. The
  elements are ordered lexicographically according to the order of the
  input collection.
  
  <p>
  There are no guarantees on the type, mutability, serializability, or
  thread-safety of the {@code List} elements. It's however guaranteed that
  each element is the distinct object.
  
  <p>
  The supplied collection is assumed to be unchanged during the operation.
  
  @param <T> the type of the elements
  @param n the size of the {@code List} elements of the resulting stream.
  @param source the input collection of collections which is used to
  generate the Cartesian power.
  @return the new stream of lists.
  @see #cartesianProduct(Collection)
  @since 0.3.8