filter.filter( null, cg );
	public Set findCGCPaths(@NotNull @Validate(Long.class) Set imgIds,             String algorithm, Map options) {		if (imgIds.size()==0){			return new HashSet();		}		if (! IPojos.ALGORITHMS.contains(algorithm)) {			throw new IllegalArgumentException(					"No such algorithm known:"+algorithm);		}				PojoOptions po = new PojoOptions(options);        Query q = queryFactory.lookup(                PojosCGCPathsQueryDefinition.class.getName(),                PojosQP.ids(imgIds),                PojosQP.String("algorithm",algorithm),                PojosQP.options(po.map()));        		List<List> result_set = (List) iQuery.execute(q);        Map<CategoryGroup,Set<Category>> map         = new HashMap<CategoryGroup,Set<Category>>();        Set<CategoryGroup> returnValues = new HashSet<CategoryGroup>();                // Parse        for (List result_row : result_set)        {            CategoryGroup cg = (CategoryGroup) result_row.get(0);            Category c = (Category) result_row.get(1);            if (!map.containsKey(cg)) map.put(cg,new HashSet<Category>());            map.get(cg).add(c);        }        //        // Destructive changes below this point.        //                for (CategoryGroup cg : map.keySet())        {            for (Category c : map.get(cg))            {                iQuery.evict(cg); // FIXME does this suffice?                cg.linkCategory(c);            }            returnValues.add(cg);        }        collectCounts(returnValues,po);        return returnValues;			}