Here you can find the source of toArrayList( Iterable extends T> iterable)
public static <T> ArrayList<T> toArrayList( Iterable<? extends T> iterable)
//package com.java2s; import java.util.ArrayList; public class Main { public static <T> ArrayList<T> toArrayList( Iterable<? extends T> iterable) { ArrayList<T> list = new ArrayList<>(); for (T t : iterable) list.add(t);/* w w w .j ava 2 s. com*/ return list; } }