Here you can find the source of getCollection(T... items)
Parameter | Description |
---|---|
items | the items which should be included in the Collection. |
public static <T> Collection<T> getCollection(T... items)
//package com.java2s; import java.util.ArrayList; import java.util.Collection; import java.util.List; public class Main { /**/*from ww w . j ava 2 s.c om*/ * Returns a Collection with the given items. * * @param items the items which should be included in the Collection. * @return a Collection. */ public static <T> Collection<T> getCollection(T... items) { List<T> list = new ArrayList<T>(); for (T item : items) { list.add(item); } return list; } }