src/org/kocakosm/pitaya/util/XArrays.java
public static <T> T[] concat(T[]... arrays)
	{
		Parameters.checkCondition(arrays.length > 0);
		int len = 0;
		for (T[] array : arrays) {
			len += array.length;
		}
		T[] concat = newArray(arrays[0].getClass().getComponentType(), len);
		int i = 0;
		for (T[] array : arrays) {
			System.arraycopy(array, 0, concat, i, array.length);
			i = array.length;
		}
		return concat;
	}
public static <T> T[] concat(T[]... arrays)
	{
		Parameters.checkCondition(arrays.length > 0);
		int len = 0;
		for (T[] array : arrays) {
			len += array.length;
		}
		T[] concat = newArray(arrays[0].getClass().getComponentType(), len);
		int i = 0;
		for (T[] array : arrays) {
			System.arraycopy(array, 0, concat, i, array.length);
			i = array.length;
		}
		return concat;
	}
public static < T > T [ ] concat ( T [ ] ... arrays ) { Parameters . checkCondition ( arrays . length > 0 ) ; int len = 0 ; for ( T [ ] array : arrays ) { len += array . length ; } T [ ] concat = newArray ( arrays [ 0 ] . getClass ( ) . getComponentType ( ) , len ) ; int i = 0 ; for ( T [ ] array : arrays ) { System . arraycopy ( array , 0 , concat , i , array . length ) ; i = array . length ; } return concat ; }
Concatenates the given arrays into a single one.

@param <T> the type of the elements in the arrays to concatenate.
@param arrays the arrays to concatenate.

@return the concatenated array.

@throws IllegalArgumentException if {@code arrays} is empty.
@throws NullPointerException if {@code arrays} is {@code null} or if
it contains a {@code null} reference.
Concatenates the given arrays into a single one .