Iterator i = categories.iterator(); while (i.hasNext()) group.addChildDisplay(transformCategory((CategoryData) i.next())); group.setNumberItems(categories.size());
if (categories != null) { Iterator i = categories.iterator(); while (i.hasNext()) group.addChildDisplay(transformCategory( (CategoryData) i.next())); group.setNumberItems(categories.size()); } else group.setNumberItems(0);
    private static TreeImageDisplay transformCategoryGroup(CategoryGroupData                                                            data)    {        if (data == null)            throw new IllegalArgumentException("Cannot be null");        TreeImageSet group = new TreeImageSet(data);        Set categories = data.getCategories();        Iterator i = categories.iterator();        while (i.hasNext())            group.addChildDisplay(transformCategory((CategoryData) i.next()));        group.setNumberItems(categories.size());        return group;    }