code: public static <T> Iterable<T> unmodifiableIterable(final Iterable<? extends T> iterable) {
      checkNotNull(iterable);
      if (iterable instanceof UnmodifiableIterable || iterable instanceof ImmutableCollection) {
        @SuppressWarnings("unchecked") // Since it's unmodifiable, the covariant cast is safe
        Iterable<T> result = (Iterable<T>) iterable;
        return result;
      }
      return new UnmodifiableIterable<>(iterable);
    }
docs: Returns an unmodifiable view of {@code iterable}.