HttpServletRequest request) { Collection<Announcement> announcements = (board.getWriters() == null || board.getWriters() .allows(getUserView(request))) ? board.getAnnouncements() : board .getActiveAnnouncements(); Collection<Announcement> thisMonthAnnouncements = new ArrayList<Announcement>();
HttpServletRequest request) { Collection<Announcement> announcements = board.hasWriter(getLoggedPerson(request)) ? board .getAnnouncements() : board.getActiveAnnouncements(); Collection<Announcement> thisMonthAnnouncements = new ArrayList<Announcement>();
    private Collection<Announcement> getThisMonthAnnouncements(AnnouncementBoard board,            HttpServletRequest request) {        Collection<Announcement> announcements = (board.getWriters() == null || board.getWriters()                .allows(getUserView(request))) ? board.getAnnouncements() : board                .getActiveAnnouncements();        Collection<Announcement> thisMonthAnnouncements = new ArrayList<Announcement>();        DateTime now = new DateTime();        for (Announcement announcement : announcements) {            if (announcement.getCreationDate().getMonthOfYear() == now.getMonthOfYear()                    && announcement.getCreationDate().getYear() == now.getYear())                thisMonthAnnouncements.add(announcement);        }        return thisMonthAnnouncements;    }