private void setLegalRegimen(HttpServletRequest request, ExecutionPeriod executionPeriod, Teacher teacher) { List<TeacherLegalRegimen> teacherLegalRegimens = teacher .getAllLegalRegimensWithoutEndSituations(executionPeriod.getBeginDateYearMonthDay(), executionPeriod .getEndDateYearMonthDay());  if (!teacherLegalRegimens.isEmpty()) { Collections.sort(teacherLegalRegimens, new BeanComparator("beginDate")); request.setAttribute("legalRegimen", teacherLegalRegimens.get(0));
private void setLegalRegimen(HttpServletRequest request, OccupationPeriod occupationPeriod, Teacher teacher) { if(occupationPeriod != null) { TeacherLegalRegimen lastLegalRegimen = teacher.getLastLegalRegimenWithoutEndSituations(occupationPeriod.getStartYearMonthDay(), occupationPeriod.getEndYearMonthDay()); if (lastLegalRegimen != null) { request.setAttribute("legalRegimen", lastLegalRegimen); }
    private void setLegalRegimen(HttpServletRequest request, ExecutionPeriod executionPeriod, Teacher teacher) {        List<TeacherLegalRegimen> teacherLegalRegimens = teacher                .getAllLegalRegimensWithoutEndSituations(executionPeriod.getBeginDateYearMonthDay(), executionPeriod                        .getEndDateYearMonthDay());        if (!teacherLegalRegimens.isEmpty()) {            Collections.sort(teacherLegalRegimens, new BeanComparator("beginDate"));            request.setAttribute("legalRegimen", teacherLegalRegimens.get(0));        }    }    