Iterator i = datasets.iterator(); while (i.hasNext()) project.addChildDisplay(transformDataset((DatasetData) i.next())); project.setNumberItems(datasets.size());
if (datasets != null) { Iterator i = datasets.iterator(); while (i.hasNext()) project.addChildDisplay(transformDataset( (DatasetData) i.next())); project.setNumberItems(datasets.size()); } else project.setNumberItems(0);
    private static TreeImageDisplay transformProject(ProjectData data)    {        if (data == null)            throw new IllegalArgumentException("Cannot be null");        TreeImageSet project = new TreeImageSet(data);        Set datasets = data.getDatasets();        Iterator i = datasets.iterator();        while (i.hasNext())             project.addChildDisplay(transformDataset((DatasetData) i.next()));        project.setNumberItems(datasets.size());        return project;    }