Here you can find the source of join(T[] arr1, T[] arr2)
public static <T> T[] join(T[] arr1, T[] arr2)
//package com.java2s; import java.util.*; public class Main { public static <T> T[] join(T[] arr1, T[] arr2) { if (arr1 == null || arr1.length == 0) { return arr2; }/*from www . j a va2s . c om*/ if (arr2 == null || arr2.length == 0) { return arr1; } T[] newArrays = (T[]) Arrays.copyOf(arr1, arr1.length + arr2.length, arr1.getClass()); System.arraycopy(arr2, 0, newArrays, arr1.length, arr2.length); return newArrays; } }