final String key = homepage.getName().substring(0, 1); final SortedSet<Homepage> sortedSet; if (homepages.containsKey(key)) { sortedSet = homepages.get(key); sortedSet.add(homepage);
if (homepage.getActivated().booleanValue()) { final String key = homepage.getName().substring(0, 1); final SortedSet<Homepage> sortedSet; if (homepages.containsKey(key)) { sortedSet = homepages.get(key); sortedSet.add(homepage); }
    public ActionForward list(ActionMapping mapping, ActionForm actionForm,            HttpServletRequest request, HttpServletResponse response) throws Exception {    	final SortedMap<String, SortedSet<Homepage>> homepages = new TreeMap<String, SortedSet<Homepage>>();    	for (int i = (int) 'A'; i <= (int) 'Z'; i++) {    		homepages.put("" + ((char) i), new TreeSet<Homepage>(Homepage.HOMEPAGE_COMPARATOR_BY_NAME));    	}    	for (final Homepage homepage : rootDomainObject.getHomepagesSet()) {    		final String key = homepage.getName().substring(0, 1);    		final SortedSet<Homepage> sortedSet;    		if (homepages.containsKey(key)) {    			sortedSet = homepages.get(key);    			sortedSet.add(homepage);    		}    	}    	request.setAttribute("homepages", homepages);    	final String selectedPage = request.getParameter("selectedPage");    	if (selectedPage != null) {    		request.setAttribute("selectedPage", selectedPage);    	} else {    		request.setAttribute("selectedPage", "");    	}        return mapping.findForward("list-homepages");    }