Here you can find the source of max(T v1, T v2)
public static <T extends Comparable<T>> T max(T v1, T v2)
//package com.java2s; //License from project: Apache License public class Main { public static <T extends Comparable<T>> T max(T v1, T v2) { return v1.compareTo(v2) < 0 ? v2 : v1; }/*from w w w . j a v a 2 s .c o m*/ }