public static <T>Object[] merge(Object[] a,Object[] b,Class<T> klass){
  if (a == null)   return b;
  if (b == null)   return a;
  Object[] arrrrray=(Object[])Array.newInstance(klass,(a.length + b.length));
  System.arraycopy(a,0,arrrrray,0,a.length);
  System.arraycopy(b,0,arrrrray,a.length,b.length);
  return arrrrray;
}

public static < T > Object [ ] merge ( Object [ ] a , Object [ ] b , Class < T > klass ) { if ( a == null ) return b ; if ( b == null ) return a ; Object [ ] arrrrray = ( Object [ ] ) Array . newInstance ( klass , ( a . length + b . length ) ) ; System . arraycopy ( a , 0 , arrrrray , 0 , a . length ) ; System . arraycopy ( b , 0 , arrrrray , a . length , b . length ) ; return arrrrray ; }
fast utility method to merge arrays .
