public static <T> T max( List<T> list, String sortBy ) {

        if (list.size()>1) {
            Sorting.sortDesc(list, sortBy);

            return list.get(0);
        } else {
            return null;
        }
    }
public static <T> T max( List<T> list, String sortBy ) {

        if (list.size()>1) {
            Sorting.sortDesc(list, sortBy);

            return list.get(0);
        } else {
            return null;
        }
    }
public static < T > T max ( List < T > list , String sortBy ) { if ( list . size ( ) > 1 ) { Sorting . sortDesc ( list , sortBy ) ; return list . get ( 0 ) ; } else { return null ; } }
Returns the max value of the object with the property given.

@param list
@param sortBy
@param <T>
@return
Returns the max value of the object with the property given .