unitAnnouncementBoards = CollectionUtils.select(unitAnnouncementBoards, new AnnouncementBoard.AcessLevelPredicate(level, getLoggedPerson(request))); unitAnnouncementBoards = CollectionUtils.select(unitAnnouncementBoards, new AnnouncementBoard.AcessTypePredicate(type, getLoggedPerson(request)));  executionCourseAnnouncementBoards = CollectionUtils.select(executionCourseAnnouncementBoards, new AnnouncementBoard.AcessLevelPredicate(level, getLoggedPerson(request)));  executionCourseAnnouncementBoards = CollectionUtils.select(executionCourseAnnouncementBoards, new AnnouncementBoard.AcessTypePredicate(type, getLoggedPerson(request)));
unitAnnouncementBoards = (Collection<UnitAnnouncementBoard>) filterAnnouncementBoardsByLevelAndType(request, unitAnnouncementBoards, level, type); executionCourseAnnouncementBoards = (Collection<ExecutionCourseAnnouncementBoard>) filterAnnouncementBoardsByLevelAndType(request, executionCourseAnnouncementBoards, level, type);
    public ActionForward handleBoardListing(ActionMapping mapping, ActionForm actionForm,            HttpServletRequest request, HttpServletResponse response) throws Exception {        final AnnouncementsStartPageForm form = (AnnouncementsStartPageForm) actionForm;        Collection<UnitAnnouncementBoard> unitAnnouncementBoards = new TreeSet<UnitAnnouncementBoard>(AnnouncementBoard.BY_NAME);        Collection<ExecutionCourseAnnouncementBoard> executionCourseAnnouncementBoards = new TreeSet<ExecutionCourseAnnouncementBoard>(ExecutionCourseAnnouncementBoard.COMPARE_BY_EXECUTION_PERIOD_AND_NAME);        for (final AnnouncementBoard board : rootDomainObject.getAnnouncementBoards()) {            if (board.hasReader(getLoggedPerson(request)) || board.hasWriter(getLoggedPerson(request)) ) {        	                if (board instanceof UnitAnnouncementBoard) {                    unitAnnouncementBoards.add((UnitAnnouncementBoard) board);                } else if (board instanceof ExecutionCourseAnnouncementBoard) {                    ExecutionCourseAnnouncementBoard executionCourseBoard = (ExecutionCourseAnnouncementBoard) board;                    if (executionCourseBoard.getExecutionCourse().getExecutionPeriod().getState().equals(PeriodState.CURRENT)) {                	executionCourseAnnouncementBoards.add(executionCourseBoard);                    }                }            }        }        final AnnouncementBoardAccessLevel level = AnnouncementBoardAccessLevel.valueOf(form.getAnnouncementBoardAccessLevel());        final AnnouncementBoardAccessType type = AnnouncementBoardAccessType.valueOf(form.getAnnouncementBoardAccessType());        unitAnnouncementBoards = CollectionUtils.select(unitAnnouncementBoards,                new AnnouncementBoard.AcessLevelPredicate(level, getLoggedPerson(request)));        unitAnnouncementBoards = CollectionUtils.select(unitAnnouncementBoards,                new AnnouncementBoard.AcessTypePredicate(type, getLoggedPerson(request)));                executionCourseAnnouncementBoards = CollectionUtils.select(executionCourseAnnouncementBoards,        	new AnnouncementBoard.AcessLevelPredicate(level, getLoggedPerson(request)));                executionCourseAnnouncementBoards = CollectionUtils.select(executionCourseAnnouncementBoards,        	new AnnouncementBoard.AcessTypePredicate(type, getLoggedPerson(request)));        request.setAttribute("executionCourseAnnouncementBoards",                getPagedExecutionCourseAnnouncementBoard(executionCourseAnnouncementBoards, request));                request.setAttribute("unitAnnouncementBoards", getPagedUnitAnnouncementBoard(                unitAnnouncementBoards, request));                request.setAttribute("returnMethod", "handleBoardListing");                return mapping.findForward("boardListingWithCriteria");    }