YearMonthDay lessonEndDay = getLessonEndDay(); YearMonthDay currentDate = new YearMonthDay();  YearMonthDay startDateToSearch = getLessonStartDay(); YearMonthDay endDateToSearch = (lessonEndDay.isAfter(currentDate)) ? currentDate : lessonEndDay;  Campus lessonCampus = getLessonCampus();  if (date != null && !Holiday.isHoliday(date, lessonCampus) && !startDateToSearch.isAfter(endDateToSearch)) { while (true) { if (startDateToSearch.isEqual(date)) { return true; } startDateToSearch = startDateToSearch.plusDays(7); if (startDateToSearch.isAfter(endDateToSearch)) { return false; } } } return false;
List<YearMonthDay> allLessonDatesEvenToday = getAllLessonDatesEvenToday(); return (allLessonDatesEvenToday.isEmpty() || date == null) ? false : allLessonDatesEvenToday .contains(date);
    public boolean isDateValidToInsertSummary(YearMonthDay date) {	YearMonthDay lessonEndDay = getLessonEndDay();	YearMonthDay currentDate = new YearMonthDay();	YearMonthDay startDateToSearch = getLessonStartDay();	YearMonthDay endDateToSearch = (lessonEndDay.isAfter(currentDate)) ? currentDate : lessonEndDay;	Campus lessonCampus = getLessonCampus();	if (date != null && !Holiday.isHoliday(date, lessonCampus)		&& !startDateToSearch.isAfter(endDateToSearch)) {	    while (true) {		if (startDateToSearch.isEqual(date)) {		    return true;		}		startDateToSearch = startDateToSearch.plusDays(7);		if (startDateToSearch.isAfter(endDateToSearch)) {		    return false;		}	    }	}	return false;    }