Here you can find the source of appendToList(List
private static <T> List<T> appendToList(List<T> list, T[] elements)
//package com.java2s; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class Main { private static <T> List<T> appendToList(List<T> list, T[] elements) { List<T> result = new ArrayList<T>(list.size() + elements.length); result.addAll(list);/* w ww. j av a 2s .c o m*/ result.addAll(Arrays.asList(elements)); return result; } }