Returns an immutable list containing the given elements, in order.

@throws NullPointerException if any of {@code elements} is null
@since 3.0
498671
public static <E> ImmutableList<E> copyOf(E[] elements) {
    switch (elements.length) {
      case 0:
        return ImmutableList.of();
      case 1:
        return new SingletonImmutableList<E>(elements[0]);
      default:
        return new RegularImmutableList<E>(checkElementsNotNull(elements.clone()));
    }
  }
306525
protected Elements getFirst(Elements elems) {
        @SuppressWarnings("unchecked")
        IterableElements<Elements> iterableElems = elems.as(IterableElements.class);
        return Iterables.getFirst(iterableElems, null);
    }
159231
public List<CmsContainerElementBean> getElements() {

        if (m_elements == null) {
            m_elements = new ArrayList<CmsContainerElementBean>();
            for (CmsContainerBean container : m_containers.values()) {
                m_elements.addAll(container.getElements());
            }
        }
        return m_elements;
    }
1196025
public Enumeration elements() {
		Iterator iter;
		Vector list;

		iter = m_Words.iterator();
		list = new Vector();

		while (iter.hasNext())
			list.add(iter.next());

		// sort list
		Collections.sort(list);

		return list.elements();
	}
80776
@Override
  public ImmutableList<E> subList(int fromIndex, int toIndex) {
    checkPositionIndexes(fromIndex, toIndex, size());
    int length = toIndex - fromIndex;
    if (length == size()) {
      return this;
    }
    switch (length) {
      case 0:
        return of();
      case 1:
        return of(get(fromIndex));
      default:
        return subListUnchecked(fromIndex, toIndex);
    }
  }
704760
public static <T> List<T> toImmutableList(final List<? extends T> list) {
    switch (list.size()) {
      case 0:
        return Collections.emptyList();
      case 1:
        return Collections.singletonList(list.get(0));
      default:
        return Collections.unmodifiableList(list);
    }
  }
751546
public List<WebElement> getElements() {
        List<WebElement> foundElements = null;
        try {
            if (parent == null) {
                foundElements = HtmlElementUtils.locateElements(getLocator());
            } else {
                foundElements = parent.locateChildElements(getLocator());
            }
        } catch (NoSuchElementException n) {
            addInfoForNoSuchElementException(n);
        }

        return foundElements;
    }
376557
static <T> List<T> list(T... elements) {
    return new ArrayList<>(Arrays.asList(elements));
  }
626921
public static <A> List<A> list(A... elements) {
        final List<A> list = new ArrayList<A>(elements.length);
        for (A element : elements) {
            list.add(element);
        }
        return list;
    }
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());
  }
293403
@Override
    protected List<BenchmarkElement> arrangeList(final List<BenchmarkElement> elements) {
        final List<BenchmarkElement> elementList = new LinkedList<BenchmarkElement>();
        elementList.addAll(elements);
        return elementList;
    }
151628
public static List<TypeElement>
            typesIn(Iterable<? extends Element> elements) {
        return listFilter(elements, TYPE_KINDS, TypeElement.class);
    }
1302964
@SafeVarargs
    public static <T> Set<T> of(T... elements) {
        Preconditions.checkNotNull(elements);
        return ImmutableSet.<T> builder().addAll(elements).build();
    }
622685
public static <T> List<T> toList(Iterable<T> iterable) {
        List<T> list = null;

        if (iterable != null) {
            list = new ArrayList<>();
            for (T elem : iterable) {
                list.add(elem);
            }
        }

        return list;
    }
1226701
@Nonnull
    @SafeVarargs
    public static <A> ImmutableList<A> from(@Nonnull A... el) {
        return fromBounded(el, 0, el.length);
    }
474570
public static <E> ArrayList<E> newArrayList(Iterator<? extends E> elements) {
		ArrayList<E> list = newArrayList();
		while (elements.hasNext()) {
			list.add(elements.next());
		}
		return list;
	}
1001805
public static <E> List<E> copyOf(E[] elements) {
    Preconditions.checkNotNull(elements, "elements");
    List<E> result = new ArrayList<>(elements.length);
    Collections.addAll(result, elements);
    return Collections.unmodifiableList(result);
  }