src/org/kocakosm/pitaya/util/XArrays.java
public static <T> T[] reverse(T[] a)
	{
		int len = a.length;
		T[] copy = newArray(a.getClass().getComponentType(), len);
		for (int i = 0; i < len; i++) {
			copy[i] = a[len - i - 1];
		}
		return copy;
	}
public static <T> T[] reverse(T[] a)
	{
		int len = a.length;
		T[] copy = newArray(a.getClass().getComponentType(), len);
		for (int i = 0; i < len; i++) {
			copy[i] = a[len - i - 1];
		}
		return copy;
	}
public static < T > T [ ] reverse ( T [ ] a ) { int len = a . length ; T [ ] copy = newArray ( a . getClass ( ) . getComponentType ( ) , len ) ; for ( int i = 0 ; i < len ; i ++ ) { copy [ i ] = a [ len - i - 1 ] ; } return copy ; }
Returns a new array containing the same elements as the given one,
but in reverse order.

@param <T> the type of the elements in the array to reverse.
@param a the array to reverse.

@return the reversed array.

@throws NullPointerException if {@code a} is {@code null}.
Returns a new array containing the same elements as the given one but in reverse order .