Here you can find the source of mergeLists(List
public static <E> List<E> mergeLists(List<E> first, List<E> second)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { public static <E> List<E> mergeLists(List<E> first, List<E> second) { List<E> merged = new ArrayList<E>(first); for (E obj : second) { if (!merged.contains(obj)) merged.add(obj);//from ww w.ja va 2s. co m } return merged; } }