Here you can find the source of concat(List extends T> l1, List extends T> l2)
public static <T> List<? extends T> concat(List<? extends T> l1, List<? extends T> l2)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { public static <T> List<? extends T> concat(List<? extends T> l1, List<? extends T> l2) { List<T> list = new ArrayList<>(); list.addAll(l1);//from w w w .j a va2 s. c o m list.addAll(l2); return list; } }