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