Here you can find the source of merge(T[]... many)
public static <T> List<T> merge(T[]... many)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static <T> List<T> merge(List<T>... many) { ArrayList<T> ret = new ArrayList(); for (List<T> list : many) { if (list != null) { for (T val : list) { if (!ret.contains(val)) { ret.add(val); }/*from w ww . j a v a 2s. c o m*/ } } } ret.trimToSize(); return ret; } public static <T> List<T> merge(T[]... many) { ArrayList<T> ret = new ArrayList(); for (T[] list : many) { if (list != null) { for (T val : list) { if (!ret.contains(val)) { ret.add(val); } } } } ret.trimToSize(); return ret; } }