Here you can find the source of arrayToCollection(Collection
public static <T> Collection<T> arrayToCollection(Collection<T> collection, T[] elements)
//package com.java2s; //License from project: Apache License import java.util.Collection; public class Main { public static <T> Collection<T> arrayToCollection(Collection<T> collection, T[] elements) { for (T element : elements) { collection.add(element);/* ww w .ja v a 2s . c o m*/ } return collection; } }