link = ModelMapper.unlinkChildFromParent( ((DataObject) i.next()).asImage(), mParent); if (link != null) links.add(link);
link = gateway.findLink(Category.class, mParent, ((DataObject) i.next()).asImage()); if (link != null) links.add(link);
    public void declassify(Set images, Set categories)            throws DSOutOfServiceException, DSAccessException    {        try {            images.toArray(new ImageData[] {});        } catch (ArrayStoreException ase) {            throw new IllegalArgumentException(                    "The images set only contains ImageData elements.");        }        try {            categories.toArray(new CategoryData[] {});        } catch (ArrayStoreException ase) {            throw new IllegalArgumentException(                    "The categories set only contains CategoryData elements.");        }        Iterator category = categories.iterator();        List links = new ArrayList();        Iterator i;        IObject mParent;        IObject link;        while (category.hasNext()) {            mParent = ((DataObject) category.next()).asIObject();            i = images.iterator();            while (i.hasNext()) {                link = ModelMapper.unlinkChildFromParent(                        ((DataObject) i.next()).asImage(), mParent);                if (link != null)                    links.add(link);            }           }        if (links != null) {            gateway.deleteObjects((IObject[])                     links.toArray(new IObject[links.size()]));        }    }