Here you can find the source of newArrayList(Iterable
public static <E> ArrayList<E> newArrayList(Iterable<E> iterable)
//package com.java2s; // Use of this source code is governed by a BSD-style license that can be import java.util.ArrayList; import java.util.Collections; public class Main { public static <E> ArrayList<E> newArrayList(E... elements) { ArrayList<E> list = new ArrayList<E>(elements.length); Collections.addAll(list, elements); return list; }/* www .j a v a 2 s. c o m*/ public static <E> ArrayList<E> newArrayList(Iterable<E> iterable) { ArrayList<E> list = new ArrayList<E>(); for (E element : iterable) list.add(element); return list; } }