A convenience method for creating an immutable list

@param self a List
@return an immutable List
@see java.util.Collections#unmodifiableList(java.util.List)
@since 1.0
493416
public static <T> List<T> asImmutable(List<? extends T> self) {
        return Collections.unmodifiableList(self);
    }
569939
public static <T> Set<T> asUnmodifiable(Set<T> self) {
        return Collections.unmodifiableSet(self);
    }
997681
@Nonnull
    public ImmutableList<T> toList() {
        return this.foldAbelian((v, acc) -> acc.cons(v), ImmutableList.empty());
    }
1226701
@Nonnull
    @SafeVarargs
    public static <A> ImmutableList<A> from(@Nonnull A... el) {
        return fromBounded(el, 0, el.length);
    }
11073
public <T> List<T> cloneList(List<T> list) {
        return new ArrayList<T>(list);
    }
464181
public static <T> Iterable<T> each(Iterable<T> self, @ClosureParams(FirstParam.FirstGenericType.class) Closure closure) {
        each(self.iterator(), closure);
        return self;
    }
917505
private SoyList newListFromIterable(Iterable<?> items) {
    // Create a list backed by a Java list which has eagerly converted each value into a lazy
    // value provider. Specifically, the list iteration is done eagerly so that the lazy value
    // provider can cache its value.
    ImmutableList.Builder<SoyValueProvider> builder = ImmutableList.builder();
    for (Object item : items) {
      builder.add(convertLazy(item));
    }
    return ListImpl.forProviderList(builder.build());
  }
1129014
public static <K,V> Map<K,V> asImmutable(Map<? extends K, ? extends V> self) {
        return Collections.unmodifiableMap(self);
    }
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();
            }
        };
    }
1302567
public <E> List<E> unmodifiable(List<E> input)
    {
        if (input == null) {
            return null;
        }
        return Collections.unmodifiableList(input);
    }
611037
public static <T> List<T> toList(Enumeration<T> self) {
        List<T> answer = new ArrayList<T>();
        while (self.hasMoreElements()) {
            answer.add(self.nextElement());
        }
        return answer;
    }
8798
public static <K, V> Map<K, V> asUnmodifiable(Map<K, V> self) {
        return Collections.unmodifiableMap(self);
    }
336019
public static final <K,V> MapList<K,V> unmodifiableMapList(MapList<K,V> map)
    {
        return new UnmodifiableMapList(Collections.unmodifiableMap(map), map.getComparator());
    }
396278
public static <T> ImmutableList<T> asUniquedList(Iterable<T> items) {
    return ImmutableSet.copyOf(items).asList();
  }
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);
    }
806152
public static <T> List<T> list(Iterable<T> iterable)
	{
		List<T> list = new ArrayList<T>();

		for (T item : iterable)
		{
			list.add(item);
		}
		return list;
	}
107018
public static <K,V> SortedMap<K,V> asImmutable(SortedMap<K, ? extends V> self) {
        return Collections.unmodifiableSortedMap(self);
    }