Here you can find the source of asArrayList(Collection
Parameter | Description |
---|---|
collection | a parameter |
E | < > |
public static <E> ArrayList<E> asArrayList(Collection<E> collection)
//package com.java2s; import java.util.ArrayList; import java.util.Collection; public class Main { /**/*w w w .j a v a 2 s . co m*/ * Takes any collection and turns it into an {@link java.util.ArrayList} * @param collection * @param <E> * @return */ public static <E> ArrayList<E> asArrayList(Collection<E> collection) { ArrayList<E> arrayList = new ArrayList<>(); arrayList.addAll(collection); return arrayList; } }