android/guava/src/com/google/common/collect/Lists.java
@GwtCompatible(serializable = true)
  public static <E> ArrayList<E> newArrayList(Iterable<? extends E> elements) {
    checkNotNull(elements); // for GWT
    // Let ArrayList's sizing logic work, if possible
    return (elements instanceof Collection)
        ? new ArrayList<>(Collections2.cast(elements))
        : newArrayList(elements.iterator());
  }
@GwtCompatible(serializable = true)
  public static <E> ArrayList<E> newArrayList(Iterable<? extends E> elements) {
    checkNotNull(elements); // for GWT
    // Let ArrayList's sizing logic work, if possible
    return (elements instanceof Collection)
        ? new ArrayList<>(Collections2.cast(elements))
        : newArrayList(elements.iterator());
  }
Creates a <i>mutable</i> {@code ArrayList} instance containing the given elements; a very thin
shortcut for creating an empty list then calling {@link Iterables#addAll}.

<p><b>Note:</b> if mutability is not required and the elements are non-null, use {@link
ImmutableList#copyOf(Iterable)} instead. (Or, change {@code elements} to be a {@link
FluentIterable} and call {@code elements.toList()}.)

<p><b>Note for Java 7 and later:</b> if {@code elements} is a {@link Collection}, you don't
need this method. Use the {@code ArrayList} {@linkplain ArrayList#ArrayList(Collection)
constructor} directly, taking advantage of the new <a href="http://goo.gl/iz2Wi">"diamond"
syntax</a>.