for (final AnnouncementBoard board : rootDomainObject.getAnnouncementBoards()) { if (board.getMandatory() && (board.hasReader(getLoggedPerson(request)) || board.hasWriter(getLoggedPerson(request)))) { announcementsToShow.addAll(board.getVisibleAnnouncements()); } }  final AnnouncementsStartPageForm form = (AnnouncementsStartPageForm) actionForm; Collections.sort(announcementsToShow, Announcement.NEWEST_FIRST); return announcementsToShow.subList(0, Math.min(form.getHowManyAnnouncementsToShow(), announcementsToShow.size()));
Collections.sort(result, Announcement.NEWEST_FIRST); return result.subList(0, Math.min(form.getHowManyAnnouncementsToShow(), result.size()));
    private List<Announcement> getAnnouncementsToShow(HttpServletRequest request, ActionForm actionForm) {	        final List<Announcement> announcementsToShow = new ArrayList<Announcement>();                for (final AnnouncementBoard board : getLoggedPerson(request).getBookmarkedBoards()) {            if (board.hasReader(getLoggedPerson(request)) || board.hasWriter(getLoggedPerson(request))) {        	announcementsToShow.addAll(board.getVisibleAnnouncements());            }        }        for (final AnnouncementBoard board : rootDomainObject.getAnnouncementBoards()) {            if (board.getMandatory() && (board.hasReader(getLoggedPerson(request)) || board.hasWriter(getLoggedPerson(request)))) {        	announcementsToShow.addAll(board.getVisibleAnnouncements());            }        }        final AnnouncementsStartPageForm form = (AnnouncementsStartPageForm) actionForm;        Collections.sort(announcementsToShow, Announcement.NEWEST_FIRST);        return announcementsToShow.subList(0, Math.min(form.getHowManyAnnouncementsToShow(), announcementsToShow.size()));    }