Here you can find the source of addToList(List
public static <T> void addToList(List<T> list, T[] array)
//package com.java2s; //License from project: Apache License import java.util.List; public class Main { public static <T> void addToList(List<T> list, T[] array) { if (list == null || array == null) return; for (T t : array) list.add(t);/*from w w w. ja v a2 s. c o m*/ } }