List<TeacherLegalRegimen> list = getAllLegalRegimensWithoutSpecialSituations(begin, end);
List<TeacherLegalRegimen> list = getAllLegalRegimensWithoutEndSituations(begin, end);
    public int getHoursByCategory(Date begin, Date end) {        List<TeacherLegalRegimen> list = getAllLegalRegimensWithoutSpecialSituations(begin, end);        if (list.isEmpty()) {            return 0;        } else {            Collections.sort(list, new BeanComparator("beginDate"));            return (list.get(list.size() - 1).getLessonHours() == null) ? 0 : list.get(list.size() - 1)                    .getLessonHours();        }    }