Here you can find the source of max(final NUMBER_TYPE number1, final NUMBER_TYPE number2)
public static <NUMBER_TYPE extends Number> NUMBER_TYPE max(final NUMBER_TYPE number1, final NUMBER_TYPE number2)
//package com.java2s; public class Main { public static <NUMBER_TYPE extends Number> NUMBER_TYPE max(final NUMBER_TYPE number1, final NUMBER_TYPE number2) { if (number1 == null && number2 == null) { return null; } else if (number1 == null) { return number2; } else if (number2 == null) { return number1; } else if (number1.doubleValue() > number2.doubleValue()) { return number1; } else {/*from w w w .j a v a 2s. co m*/ return number2; } } }