Here you can find the source of concat(final Collection extends T>... lists)
Parameter | Description |
---|---|
T | a parameter |
lists | a parameter |
public static <T> List<T> concat(final Collection<? extends T>... lists)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.Collection; import java.util.List; public class Main { /**/*w w w.j av a 2 s .co m*/ * Concatenates a number of Collections into a single List * * @param <T> * @param lists * * @return */ public static <T> List<T> concat(final Collection<? extends T>... lists) { ArrayList<T> al = new ArrayList<T>(); for (Collection<? extends T> list : lists) if (list != null) al.addAll(list); return al; } }