Here you can find the source of convertCollectionToList(final Collection
public static <T> List<T> convertCollectionToList(final Collection<T> collection)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.Collection; import java.util.List; public class Main { public static <T> List<T> convertCollectionToList(final Collection<T> collection) { if (List.class.isAssignableFrom(collection.getClass())) { return (List<T>) collection; }/*from w w w . j a v a 2 s .com*/ return new ArrayList<>(collection); } }