Here you can find the source of mergerList(List
public static <T> List<T> mergerList(List<T> sources, List<T> targets)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.Collection; import java.util.List; public class Main { public static <T> List<T> mergerList(List<T> sources, List<T> targets) { List<T> results = new ArrayList<T>(); if (sources != null && !sources.isEmpty()) { results.addAll(sources);/*from w w w.j a v a 2s . co m*/ } if (targets != null && !targets.isEmpty()) { results.addAll(targets); } return results; } public static <T> List<T> mergerList(List<List<T>> sources) { List<T> results = new ArrayList<T>(); if (sources == null || sources.isEmpty()) { return results; } for (List<T> source : sources) { if (source == null || source.isEmpty()) { continue; } results.addAll(source); } return results; } public static boolean isEmpty(Collection<?> entityList) { return entityList == null || entityList.isEmpty(); } }