org.linkedin.util-core/src/main/java/org/linkedin/util/collections/CollectionsUtils.java
public static <T> T[] reverse(T[] array)
  {
    if(array == null)
      return array;

    int s = 0;
    int e = array.length - 1;
    while(s < e)
    {
      // swap index e and s
      T tmp = array[e];
      array[e] = array[s];
      array[s] = tmp;

      s++;
      e--;
    }

    return array;
  }
public static <T> T[] reverse(T[] array)
  {
    if(array == null)
      return array;

    int s = 0;
    int e = array.length - 1;
    while(s < e)
    {
      // swap index e and s
      T tmp = array[e];
      array[e] = array[s];
      array[s] = tmp;

      s++;
      e--;
    }

    return array;
  }
public static < T > T [ ] reverse ( T [ ] array ) { if ( array == null ) return array ; int s = 0 ; int e = array . length - 1 ; while ( s < e ) { // swap index e and s T tmp = array [ e ] ; array [ e ] = array [ s ] ; array [ s ] = tmp ; s ++ ; e -- ; } return array ; }
Reverses the array in place.
@param array the array to reverse
@return the <em>same</em> array provided NOT a new one!
Reverses the array in place .