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)
| 228 | |
| 229 | |
| 230 | public static <E> ImmutableList<E> copyOf(Iterable<? extends E> elements) { |
| 231 | checkNotNull(elements); // TODO(kevinb): is this here only for GWT? |
| 232 | return (elements instanceof Collection) |
| 233 | ? copyOf((Collection<? extends E>) elements) |
| 234 | : copyOf(elements.iterator()); |
| 235 | } |
| 236 | |
| 237 | /** |
| 238 | * Returns an immutable list containing the given elements, in order. |
no test coverage detected