Here you can find the source of collectionToList(Collection
public static <E> List<E> collectionToList(Collection<E> theset)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.Collection; import java.util.List; public class Main { public static <E> List<E> collectionToList(Collection<E> theset) { List<E> thelist = new ArrayList<E>(); for (E obj : theset) thelist.add(obj);// w w w . j ava 2s. c o m return thelist; } }