setImages(new HashSet( c.collectFromImageLinks( block ))); List cats = c.collectFromCategoryGroupLinks( block ); this.setGroup( cats.size() > 0 ? (CategoryGroupData) cats.get(0) : null); if ( cats.size() > 1 )
setImages(new HashSet( c.eachLinkedImage( block ))); List cgs = c.eachLinkedCategoryGroup( block ); this.setGroup( cgs.size() > 0 ? (CategoryGroupData) cgs.get(0) : null); if ( cgs.size() > 1 )
    public void copy(IObject model, ModelMapper mapper) {    	if (model instanceof Category) {			Category c = (Category) model;			super.copy(model,mapper);            // Details            Details details = c.getDetails();            if (details!=null){                this.setOwner((ExperimenterData) mapper.findTarget(details.getOwner()));            }                        // Fields			this.setName(c.getName());			this.setDescription(c.getDescription());                        // Collections            MapperBlock block = new MapperBlock( mapper );            setImages(new HashSet( c.collectFromImageLinks( block )));            List cats = c.collectFromCategoryGroupLinks( block );            this.setGroup( cats.size() > 0 ? (CategoryGroupData) cats.get(0) : null);                if ( cats.size() > 1 )            {                //  FIXME and if size > 1            }            		} else {			throw new IllegalArgumentException("CategoryData can only copy Category type.");		}    }