Here you can find the source of isBefore2015(Date date)
public static boolean isBefore2015(Date date)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { public static boolean isBefore2015(Date date) { Calendar cal = new GregorianCalendar(); cal.set(Calendar.MONTH, Calendar.JANUARY); cal.set(Calendar.DAY_OF_MONTH, 1); cal.set(Calendar.YEAR, 2015); Date fromDate = cal.getTime(); return fromDate.after(date); }//w w w . j av a2s . c o m }