private void setWorkingUnit(HttpServletRequest request, ExecutionPeriod executionPeriod, Teacher teacher) { List<Contract> contracts = teacher.getPerson().getEmployee().getContractsByPeriod( executionPeriod.getBeginDateYearMonthDay(), executionPeriod.getEndDateYearMonthDay());  if (!contracts.isEmpty()) { Collections.sort(contracts, new BeanComparator("beginDate")); request.setAttribute("workingUnit", contracts.get(0).getWorkingUnit());
private void setWorkingUnit(HttpServletRequest request, OccupationPeriod occupationPeriod, Teacher teacher) { if(occupationPeriod != null) { Unit lastWorkingUnit = teacher.getLastWorkingUnit(occupationPeriod.getStartYearMonthDay(), occupationPeriod.getEndYearMonthDay()); if(lastWorkingUnit != null) { request.setAttribute("workingUnit", lastWorkingUnit); }
    private void setWorkingUnit(HttpServletRequest request, ExecutionPeriod executionPeriod, Teacher teacher) {        List<Contract> contracts = teacher.getPerson().getEmployee().getContractsByPeriod(                executionPeriod.getBeginDateYearMonthDay(), executionPeriod.getEndDateYearMonthDay());        if (!contracts.isEmpty()) {            Collections.sort(contracts, new BeanComparator("beginDate"));            request.setAttribute("workingUnit", contracts.get(0).getWorkingUnit());        }    }