Here you can find the source of MergeArrays(T[]... arrs)
public static <T> T[] MergeArrays(T[]... arrs)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; public class Main { public static <T> T[] MergeArrays(T[]... arrs) { ArrayList<T> list = new ArrayList<T>(); for (T[] arr : arrs) { for (T t : arr) { list.add(t);// w w w . ja va 2 s .c o m } } list.trimToSize(); return list.toArray(arrs[0]); } }