Here you can find the source of isBeforeToday(Date date)
public static boolean isBeforeToday(Date date)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { /**// w ww .j a v a 2 s .c o m * Used for testing-purposes of the scheduling algorithm, where it is sometimes necessary to hack the value of * 'today'. */ public static Date testToday; public static boolean isBeforeToday(Date date) { return date.compareTo(getToday()) < 0; } public static Date getToday() { if (testToday != null) return testToday; return new Date(System.currentTimeMillis()); } }