code: public static <T> Stream<T> stream(Iterable<T> iterable) {
      return (iterable instanceof Collection)
          ? ((Collection<T>) iterable).stream()
          : StreamSupport.stream(iterable.spliterator(), false);
    }
docs: Returns a sequential {@link Stream} of the contents of {@code iterable}, delegating to {@link
  Collection#stream} if possible.