Here you can find the source of max(Calendar cal1, Calendar cal2)
public static Calendar max(Calendar cal1, Calendar cal2)
//package com.java2s; //License from project: LGPL import java.util.Calendar; import java.util.Date; public class Main { public static Calendar max(Calendar cal1, Calendar cal2) { return cal1.after(cal2) ? cal1 : cal2; }/* w w w .j av a 2 s . c om*/ public static Date max(Date date1, Date date2) { return date1.after(date2) ? date1 : date2; } }