cgd.setCategories(categories); result.add(cgd);
    public static void fillCategoryGroup(List l, List result, int userID)    {        Map cMap = new HashMap();        Iterator i = l.iterator();        CategoryGroup cg;        CategoryGroupData cgd;        CategorySummary cs;        Category c;        Iterator j;        List categories;         Integer id;        while (i.hasNext()) {            cg = (CategoryGroup) i.next();            if (cg.getModuleExecution().getExperimenter().getID() == userID) {                cgd = buildCategoryGroup(cg);                categories = new ArrayList();                if (cg.getCategoryList() != null) {                    j = cg.getCategoryList().iterator();                    while (j.hasNext()) {                        c = (Category) j.next();                        if (c.getModuleExecution().getExperimenter().getID()                                 == userID) {                            id = new Integer(c.getID());                            cs = (CategorySummary) cMap.get(id);                            if (cs == null) {                                cs = createCategorySummary(c, userID);                                cMap.put(id, cs);                            }                            //Add the categories                            categories.add(cs);                        }                    }                }                cgd.setCategories(categories);                result.add(cgd);            }        }    }