if (dayBeforeWorkTimeInterval.contains(clocking)) { return true;
if (!dayBeforeWorkTimeInterval.contains(clocking)) { return false;
    private Boolean overlapsSchedule(DateTime clocking,            HashMap<YearMonthDay, WorkSchedule> workScheduleMap) {        WorkSchedule thisDaySchedule = workScheduleMap.get(clocking.toYearMonthDay());        WorkSchedule dayBeforeSchedule = workScheduleMap.get(clocking.toYearMonthDay().minusDays(1));        if (thisDaySchedule == null) {            DateTime beginDayBeforeWorkTime = clocking.toYearMonthDay().toDateTime(                    dayBeforeSchedule.getWorkScheduleType().getWorkTime()).minusDays(1);            DateTime endDayBeforeWorkTime = clocking.toYearMonthDay().toDateTime(                    dayBeforeSchedule.getWorkScheduleType().getWorkEndTime()).minusDays(1);            if (dayBeforeSchedule.getWorkScheduleType().isWorkTimeNextDay()) {                endDayBeforeWorkTime = endDayBeforeWorkTime.plusDays(1);            }            Interval dayBeforeWorkTimeInterval = new Interval(beginDayBeforeWorkTime,                    endDayBeforeWorkTime);            if (dayBeforeWorkTimeInterval.contains(clocking)) {                return true;            }        } else if (dayBeforeSchedule != null) {            DateTime beginThisDayWorkTime = clocking.toYearMonthDay().toDateTime(                    thisDaySchedule.getWorkScheduleType().getWorkTime());            DateTime endThisDayWorkTime = clocking.toYearMonthDay().toDateTime(                    thisDaySchedule.getWorkScheduleType().getWorkEndTime());            if (thisDaySchedule.getWorkScheduleType().isWorkTimeNextDay()) {                endThisDayWorkTime = endThisDayWorkTime.plusDays(1);            }            Interval thisDayWorkTimeInterval = new Interval(beginThisDayWorkTime, endThisDayWorkTime);            DateTime beginDayBeforeWorkTime = clocking.toYearMonthDay().toDateTime(                    dayBeforeSchedule.getWorkScheduleType().getWorkTime()).minusDays(1);            DateTime endDayBeforeWorkTime = clocking.toYearMonthDay().toDateTime(                    dayBeforeSchedule.getWorkScheduleType().getWorkEndTime()).minusDays(1);            if (dayBeforeSchedule.getWorkScheduleType().isWorkTimeNextDay()) {                endDayBeforeWorkTime = endDayBeforeWorkTime.plusDays(1);            }            Interval nextDayWorkTimeInterval = new Interval(beginDayBeforeWorkTime, endDayBeforeWorkTime);            if (thisDayWorkTimeInterval.overlap(nextDayWorkTimeInterval) != null) {                return true;            }        } else {            return true;        }        return false;    }