sortedAnnotations.put(ownerID, CollectionSorter.sortAnnotationDataByDate( (List) sortedAnnotations.get(ownerID)));
annotations = (List) sortedAnnotations.get(ownerID); k = annotations.iterator(); m = new HashMap(annotations.size()); timestamps = new ArrayList(annotations.size()); while (k.hasNext()) { data = (AnnotationData) k.next(); m.put(data.getLastModified(), data); timestamps.add(data.getLastModified()); } results = sorter.sort(timestamps); l = results.iterator(); list = new ArrayList(results.size()); while (l.hasNext()) list.add(m.get(l.next())); sortedAnnotations.put(ownerID, list);
    void setAnnotations(Map map)     {        if (map == null) throw new NullPointerException("No annotations");        HashMap sortedAnnotations = new HashMap();        Set set;        Integer index;        Iterator i = map.keySet().iterator();        Iterator j;        AnnotationData annotation;        Integer ownerID;        List userAnnos;        while (i.hasNext()) {            index = (Integer) i.next();            set = (Set) map.get(index);            j = set.iterator();            while (j.hasNext()) {                annotation = (AnnotationData) j.next();;                ownerID = new Integer(annotation.getOwner().getId());                userAnnos = (List) sortedAnnotations.get(ownerID);                if (userAnnos == null) {                    userAnnos = new ArrayList();                    sortedAnnotations.put(ownerID, userAnnos);                }                userAnnos.add(annotation);            }        }        i = sortedAnnotations.keySet().iterator();        while (i.hasNext()) {            ownerID = (Integer) i.next();            sortedAnnotations.put(ownerID,                CollectionSorter.sortAnnotationDataByDate(                        (List) sortedAnnotations.get(ownerID)));        }        this.annotations = sortedAnnotations;        state = ClipBoard.ANNOTATIONS_READY;    }