Here you can find the source of merge(E[] a1, E[] a2)
public static <E> List<E> merge(E[] a1, E[] a2)
//package com.java2s; //License from project: LGPL import java.util.ArrayList; import java.util.List; public class Main { public static <E> List<E> merge(E[] a1, E[] a2) { List<E> list = new ArrayList<E>(); for (int i = 0; i < a1.length; i++) { list.add(a1[i]);// w w w . j a va 2s. c o m } for (int i = 0; i < a2.length; i++) { list.add(a2[i]); } return list; } }