pProto, DatasetSummary dProto, List annotations, int userID,
pProto, DatasetSummary dProto, List annotations,
    public static List fillListAnnotatedDatasets(List projects, ProjectSummary                     pProto, DatasetSummary dProto, List annotations, int userID,                     List projectsList)    {        Map ids = AnnotationMapper.reverseListDatasetAnnotations(annotations,                                                                 userID);        Map datasetsMap = new HashMap();        Iterator i = projects.iterator();        //DataObject.        ProjectSummary ps;        DatasetSummary ds;        Project p;        Dataset d;        Iterator j;        List datasets;        Integer id;        //For each p in projects...        while (i.hasNext()) {            p = (Project) i.next();                        //Make a new DataObject and fill it up.            ps = (ProjectSummary) pProto.makeNew();            ps.setID(p.getID());            ps.setName(p.getName());            j = p.getDatasets().iterator();            datasets = new ArrayList();            while (j.hasNext()) {                d = (Dataset) j.next();                id = new Integer(d.getID());                ds = (DatasetSummary) datasetsMap.get(id);                if (ds == null) {                    //Make a new DataObject and fill it up.                    ds = (DatasetSummary) dProto.makeNew();                         ds.setID(id.intValue());                    ds.setName(d.getName());                    ds.setAnnotation(AnnotationMapper.fillDatasetAnnotation(                            (DatasetAnnotation) ids.get(id)));                    datasetsMap.put(id, ds);                }  //object already created this object.                //Add the dataset to this project's list.                datasets.add(ds);               }                        //Link the datasets to this project.            ps.setDatasets(datasets);                        //Add the project to the list of returned projects.            projectsList.add(ps);        }                return projectsList;    }