code: public static <E> CloseableSpliterator<E> spliterator(CloseableIterator<? extends E> iterator, long size,
                                                    int characteristics) {
        return new CloseableIteratorAsCloseableSpliterator<>(iterator, size, characteristics);
     }
docs: Takes a provided closeable iterator and wraps it appropriately so it can be used as a closeable spliterator that
  will close the iterator when the spliterator is closed.
  @param iterator The closeable iterator to change to a spliterator
  @param size The approximate size of the iterator.  If no size is known {@link Long#MAX_VALUE} should be passed
  @param characteristics The characteristics of the given spliterator as defined on the {@link Spliterator}
  interface
  @param <E> The type that is the same between the iterator and spliterator
  @return A spliterator that when closed will close the provided iterator