This method will take a RichIterable and wrap it directly in a UnmodifiableRichIterable.
334536
public static <E, RI extends RichIterable<E>> UnmodifiableRichIterable<E> of(RI iterable)
    {
        if (iterable == null)
        {
            throw new IllegalArgumentException("cannot create a UnmodifiableRichIterable for null");
        }
        return new UnmodifiableRichIterable<E>(iterable);
    }
766034
public static <T> Iterable<T> simpleIterable(final Iterable<T> iterable) {
        requireNonNull(iterable);
        return () -> iterable.iterator();
    }
1081156
public static <T> Single<T> fromIterable(Iterable<T> t) {
        return Single.fromPublisher(Future.fromIterable(t));
    }
1295733
static <T> FluentCloseableIterable<T> wrap(final Iterable<T> iterable, final AutoCloseable closeable) {
        return new FluentCloseableIterable<T>() {
            @Override
            protected void doClose() {
                try {
                    closeable.close();
                } catch (RuntimeException re) {
                    throw re;
                } catch (Exception e) {
                    throw new IllegalStateException(e);
                }
            }

            @Override
            protected Iterator<T> retrieveIterator() {
                return iterable.iterator();
            }
        };
    }
181558
def wrap_iterable(obj):
    
    was_scalar = not isiterable(obj)
    wrapped_obj = [obj] if was_scalar else obj
    return wrapped_obj, was_scalar
1259228
protected Map<CharSequence, List<V>> wrapValues(Map<CharSequence, List<V>> values) {
        return Collections.unmodifiableMap(values);
    }
802399
public static <T> UnmodifiableIterator<T> filter(
      final Iterator<T> unfiltered, final Predicate<? super T> predicate) {
    checkNotNull(unfiltered);
    checkNotNull(predicate);
    return new AbstractIterator<T>() {
      @Override protected T computeNext() {
        while (unfiltered.hasNext()) {
          T element = unfiltered.next();
          if (predicate.apply(element)) {
            return element;
          }
        }
        return endOfData();
      }
    };
  }
95770
public static <T, V extends Comparable<? super V>> T maxBy(Iterable<T> iterable, Function<? super T, ? extends V> function)
    {
        if (iterable instanceof RichIterable)
        {
            return ((RichIterable<T>) iterable).maxBy(function);
        }
        if (iterable instanceof RandomAccess)
        {
            return RandomAccessListIterate.maxBy((List<T>) iterable, function);
        }
        if (iterable != null)
        {
            return IterableIterate.maxBy(iterable, function);
        }
        throw new IllegalArgumentException("Cannot perform a maxBy on null");
    }
1140945
private static <T> UnmodifiableIterator<Iterator<? extends T>> iterators(Iterable<? extends CloseableIterable<? extends T>> iterables) {
        final Iterator<? extends Iterable<? extends T>> iterableIterator = iterables.iterator();
        return new UnmodifiableIterator<Iterator<? extends T>>() {
            @Override
            public boolean hasNext() {
                return iterableIterator.hasNext();
            }

            @Override
            public Iterator<? extends T> next() {
                return iterableIterator.next().iterator();
            }
        };
    }
662520
private ImmutableSubstitution<? extends ImmutableTerm> normalizeEta(ImmutableSubstitution<ImmutableTerm> eta,
                                                                        ImmutableSet<Variable> newV) {
        return substitutionTools.prioritizeRenaming(eta, newV);
    }
626300
public static <E> Iterable<E> unmodifiableIterable(final Iterable<E> itrbl) {
	return new Iterable<E>() {
	    public Iterator<E> iterator() {
		return DSUtil.<E>unmodifiableIterator(itrbl.iterator());
	    }
	};
    }
457989
private Throwable wrapCancellationException(Throwable u) {
        Throwable wrappedException = null;
        if (u != null) {
            wrappedException = Exceptions.unwrap(u);
            if (wrappedException instanceof CancellationException) {
                wrappedException = new ReadCancellationException(wrappedException);
            }
        }
        return wrappedException;
    }
964882
private static <T> List<T> unmodifiableList(List<T> list) {
        if (list == null) {
            return Collections.emptyList();
        }
        return Collections.unmodifiableList(list);
    }
472200
private static ImmutableMap<IRI, VocabularyEntry> extractVocabulary(@Nonnull Mapping mapping) {
		return mapping.getRDFAtomPredicates().stream()
				.filter(p -> p instanceof TriplePredicate)
				.map(p -> (TriplePredicate) p)
				.findFirst()
				.map(p -> extractTripleVocabulary(mapping, p)
						.collect(ImmutableCollectors.toMap(e -> e.name, e -> e)))
				.orElseGet(ImmutableMap::of);
    }
615899
public <K, V> Map<K, V> unmodifiable(Map<K, V> input)
    {
        if (input == null) {
            return null;
        }
        return Collections.unmodifiableMap(input);
    }
1308932
public static <T> CloseableIterator<T> from(Iterator<T> iterator) {
    // early fail
    requireNonNull(iterator);
    checkArgument(!(iterator instanceof AutoCloseable), "This method does not support creating a CloseableIterator from an Iterator which is Closeable");
    return new RegularIteratorWrapper<>(iterator);
  }
1206120
public static <E, S extends SortedSet<E>> UnmodifiableSortedSet<E> of(S set)
    {
        if (set == null)
        {
            throw new IllegalArgumentException("cannot create an UnmodifiableSortedSet for null");
        }
        return new UnmodifiableSortedSet<E>(SortedSetAdapter.adapt(set));
    }