Returns an immutable list containing the given elements, in order. If elements is a Collection, this method behaves exactly as #copyOf(Collection); otherwise, it behaves exactly as copyOf(elements.iterator(). @throws NullPointerException if any of elements is
(Iterable<? extends E> elements)
| 207 | * @throws NullPointerException if any of {@code elements} is null |
| 208 | */ |
| 209 | public static <E> ImmutableList<E> copyOf(Iterable<? extends E> elements) { |
| 210 | checkNotNull(elements); // TODO(kevinb): is this here only for GWT? |
| 211 | return (elements instanceof Collection) |
| 212 | ? copyOf((Collection<? extends E>) elements) |
| 213 | : copyOf(elements.iterator()); |
| 214 | } |
| 215 | |
| 216 | /** |
| 217 | * Returns an immutable list containing the given elements, in order. |
no test coverage detected