public int getHoursByCategory(YearMonthDay begin, YearMonthDay end) { List<TeacherLegalRegimen> list = getAllLegalRegimensWithoutEndSituations(begin, end); if (!list.isEmpty()) { Collections.sort(list, new BeanComparator("beginDate")); return (list.get(list.size() - 1).getLessonHours() == null) ? 0 : list.get(list.size() - 1) .getLessonHours(); } return 0;
public int getHoursByCategory(ExecutionPeriod executionPeriod) { OccupationPeriod occupationPeriod = executionPeriod.getLessonsPeriod(); return getHoursByCategory(occupationPeriod);
    public int getHoursByCategory(YearMonthDay begin, YearMonthDay end) {        List<TeacherLegalRegimen> list = getAllLegalRegimensWithoutEndSituations(begin, end);        if (!list.isEmpty()) {            Collections.sort(list, new BeanComparator("beginDate"));            return (list.get(list.size() - 1).getLessonHours() == null) ? 0 : list.get(list.size() - 1)                    .getLessonHours();        }        return 0;    }