Here you can find the source of newArrayList(Iterable
public static <E> ArrayList<E> newArrayList(Iterable<E> iterable)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.Iterator; public class Main { public static <E> ArrayList<E> newArrayList(Iterable<E> iterable) { if (iterable == null) { throw new NullPointerException(); }/* w w w .jav a 2 s . c o m*/ ArrayList<E> list = new ArrayList<E>(); for (Iterator<E> i = iterable.iterator(); i.hasNext();) { list.add(i.next()); } return list; } }