public static Date getStartDate(Date date) {
        final Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        calendar.set(Calendar.HOUR,
            calendar.getActualMaximum(Calendar.HOUR));
        calendar.set(Calendar.MINUTE,
            calendar.getActualMaximum(Calendar.MINUTE));
        calendar.set(Calendar.SECOND,
            calendar.getActualMaximum(Calendar.SECOND));
        calendar.set(Calendar.MILLISECOND,
            calendar.getActualMaximum(Calendar.MILLISECOND));
        calendar.add(Calendar.DATE,
            -1);
        return calendar.getTime();
    }