code: private static <T extends Comparable<? super T>>
      T median( T[] arr, int left, int right )
      {
          int center = ( left + right ) / 2;
          
          if ( arr[left].compareTo( arr[center] ) > 0 )
              swapReferences( arr, left, center );
          if ( arr[left].compareTo( arr[right] ) > 0 )
              swapReferences( arr, left, right );
          if ( arr[center].compareTo( arr[right] ) > 0 )
              swapReferences( arr, center, right );
          
          swapReferences( arr, center, right - 1 );
          return arr[ right - 1 ];
      }
docs: <p>
  get the median of the left, center and right
  order these and hide the pivot by put it the end of of the array
  </p>
  
  @param arr an array of Comparable
  @param left the most-left index of the subarray
  @param right the most-right index of the subarray
  @return T