public static <T extends Object & java.lang.Comparable<? super T>>T max(Collection<? extends T> collection){
  Iterator<? extends T> it=collection.iterator();
  T max=it.next();
  if (NumberComparator.isNumber(max)) {
    return (T)max(collection,NumberComparator.createComparator(max.getClass()));
  }
  while (it.hasNext()) {
    T next=it.next();
    if (max.compareTo(next) < 0) {
      max=next;
    }
  }
  return max;
}

public static < T extends Object & java . lang . Comparable < ? super T > > T max ( Collection < ? extends T > collection ) { Iterator < ? extends T > it = collection . iterator ( ) ; T max = it . next ( ) ; if ( NumberComparator . isNumber ( max ) ) { return ( T ) max ( collection , NumberComparator . createComparator ( max . getClass ( ) ) ) ; } while ( it . hasNext ( ) ) { T next = it . next ( ) ; if ( max . compareTo ( next ) < 0 ) { max = next ; } } return max ; }
searches the specified collection for the maximum element .
