Here you can find the source of concat(List extends T> list1, List extends T> list2)
public static <T> List<T> concat(List<? extends T> list1, List<? extends T> list2)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static <T> List<T> concat(List<? extends T> list1, List<? extends T> list2) { if (list1 == null && list2 == null) { return null; }// www . j a va 2 s. co m final List<T> result = new ArrayList<>(); if (list1 != null) result.addAll(list1); if (list2 != null) result.addAll(list2); return result; } }