Here you can find the source of ToList(Iterable
public static <T> java.util.ArrayList<T> ToList(Iterable<T> inList)
//package com.java2s; //License from project: Apache License public class Main { public static <T> java.util.ArrayList<T> ToList(Iterable<T> inList) { java.util.ArrayList<T> outList = new java.util.ArrayList<T>(); for (T item : inList) { outList.add(item);/*from w w w . j a v a 2s. c o m*/ } return outList; } }