ExecutionPeriod lastExecutionPeriod = executionPeriodsBetween.get(executionPeriodsBetween .size() - 1); List<TeacherLegalRegimen> allLegalRegimens = teacher .getAllLegalRegimensWithoutEndSituations(lastExecutionPeriod.getBeginDateYearMonthDay(), lastExecutionPeriod.getEndDateYearMonthDay()); if (allLegalRegimens.isEmpty()) { return true;
ExecutionPeriod lastExecutionPeriod = executionPeriodsBetween.get(executionPeriodsBetween.size() - 1); OccupationPeriod occupationPeriod = lastExecutionPeriod.getLessonsPeriod(); if(occupationPeriod != null) { List<TeacherLegalRegimen> allLegalRegimens = teacher .getAllLegalRegimensWithoutEndSituations(occupationPeriod.getStartYearMonthDay(), occupationPeriod.getEndYearMonthDay()); if (allLegalRegimens.isEmpty()) { return true; }
    private boolean verifyIfTeacherIsInactive(Teacher teacher,            List<ExecutionPeriod> executionPeriodsBetween) {        if (!executionPeriodsBetween.isEmpty()) {            ExecutionPeriod lastExecutionPeriod = executionPeriodsBetween.get(executionPeriodsBetween                    .size() - 1);            List<TeacherLegalRegimen> allLegalRegimens = teacher                    .getAllLegalRegimensWithoutEndSituations(lastExecutionPeriod.getBeginDateYearMonthDay(),                            lastExecutionPeriod.getEndDateYearMonthDay());            if (allLegalRegimens.isEmpty()) {                return true;            }        }        return false;    }