}  List<TeacherLegalRegimen> list = getAllLegalRegimensWithoutEndSituations(occupationPeriod .getStartYearMonthDay(), occupationPeriod.getEndYearMonthDay());  if (!list.isEmpty()) { Collections.sort(list, new BeanComparator("beginDate")); return list.get(list.size() - 1).getCategory(); } return null;
} return getLastCategory(occupationPeriod.getStartYearMonthDay(), occupationPeriod.getEndYearMonthDay());
    public Category getCategoryForCreditsByPeriod(ExecutionPeriod executionPeriod) {        OccupationPeriod occupationPeriod = getLessonsPeriod(executionPeriod);        if (occupationPeriod == null) {            return null;        }                List<TeacherLegalRegimen> list = getAllLegalRegimensWithoutEndSituations(occupationPeriod                .getStartYearMonthDay(), occupationPeriod.getEndYearMonthDay());        if (!list.isEmpty()) {            Collections.sort(list, new BeanComparator("beginDate"));            return list.get(list.size() - 1).getCategory();        }        return null;    }