List updated = img.collectFromDatasetLinks( new CBlock() {
List updated = img.eachLinkedDataset( new CBlock() {
    private List unlinkImage()    {        List updated = img.collectFromDatasetLinks( new CBlock() {            public Object call(IObject arg0)            {                img.unlinkDataset( (Dataset) arg0 );                return arg0;            }        });        updated.add( img );        return updated;    }