if (log.isDebugEnabled()){ log.debug("findPDIHierarchies() -- no results found:\n"+ arg0.toString()); }
    public Set findPDIHierarchies(final Set arg0) {        // CONTRACT        if (null == arg0 || arg0.size() == 0) {            return new HashSet();        }        List result = containerDao.findPDIHierarchies(arg0);        Set imagesAll = new HashSet(result);        if (null == imagesAll || imagesAll.size() == 0) {            return new HashSet();        }        // LOGIC        Set hierarchies = new HashSet();        Iterator i = imagesAll.iterator();        while (i.hasNext()) {            Image img = (Image) i.next();            Set datasets = img.getDatasets();            if (datasets == null || datasets.size() < 1) {                hierarchies.add(img);            } else {                Iterator d = datasets.iterator();                while (d.hasNext()) {                    Dataset ds = (Dataset) d.next();                    if (!(ds.getImages() instanceof HashSet))                        ds.setImages(new HashSet());                    ds.getImages().add(img);                    Set projects = ds.getProjects();                    if (projects == null || projects.size() < 1) {                        hierarchies.add(ds);                    } else {                        Iterator p = projects.iterator();                        while (p.hasNext()) {                            Project prj = (Project) p.next();                            if (!(prj.getDatasets() instanceof HashSet))                                prj.setDatasets(new HashSet());                            prj.getDatasets().add(ds);                            hierarchies.add(prj);                        }                    }                }            }        }        return (Set) clean(hierarchies);    }