Here you can find the source of iterableToList(Iterable
public static <T> List<T> iterableToList(Iterable<T> input)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { public static <T> List<T> iterableToList(Iterable<T> input) { ArrayList<T> result = new ArrayList<>(); for (T item : input) { result.add(item);/* w w w. j a va 2 s . c o m*/ } return result; } }