logger.debug("============= Saw new Diagnosis (with UID="+d.getUID()+") -- Wrapping it.");
    protected void execute() {        Iterator iter;        //First check to see if we know where the manager is. If not, look it up (if shouldRelayDiagnoses == true).        if (managerAddress == null && shouldRelayDiagnoses) {            //Check to see if the Coordinator's address is known...            iter = managerAddressSubscription.getAddedCollection().iterator();            if (iter.hasNext()) {              // find & set the ManagerAgent address               managerAddress = ((RobustnessManagerID)iter.next()).getMessageAddress();               if (logger.isDebugEnabled()) logger.debug("ManagerAddress: "+managerAddress.toString());                              //Update the knob with status -- we know where the coordinator is               iter = knobSubscription.getCollection().iterator();                       if (iter.hasNext()) {                   diagnosesRelayManagerKnob = (DiagnosesRelayManagerKnob)iter.next();                   diagnosesRelayManagerKnob.setFoundCoordinator(managerAddress);               }                           } else {               if (logger.isDebugEnabled()) logger.debug("++++++++++++++++++++++++++++> ManagerAddress subscription empty.");            }                        }                if (managerAddress == null || !shouldRelayDiagnoses)             return; //we cannot forward diagnoses until we known where the coordinator is        //See if our knob has changed...        iter = knobSubscription.getChangedCollection().iterator();                if (iter.hasNext()) {            diagnosesRelayManagerKnob = (DiagnosesRelayManagerKnob)iter.next();            shouldRelayDiagnoses = diagnosesRelayManagerKnob.getShouldRelay();        }                //Wrap & Relay the diagnoses        if (shouldRelayDiagnoses) {                        //First get all added Diagnoses & wrap them with a DiagnosisWrapper            Collection added   = diagnosesSubscription.getAddedCollection();            for ( iter = added.iterator(); iter.hasNext() ; )             {                logger.debug("============= Saw new Diagnosis -- Wrapping it.");                Diagnosis d = (Diagnosis)iter.next();                                UID uid = this.us.nextUID(); //gen UID for this wrapper                DiagnosesWrapper dw = new DiagnosesWrapper(d, this.agentId, managerAddress, uid); //wrap the diagnosis                //registerUID(uid); //record all UIDs so we know what wrappers are out there.                d.setWrapper(dw);                this.publishAdd(dw);                            }                        //Now look at changed diagnoses            Collection changed  = diagnosesSubscription.getChangedCollection();                    Collection wrappers = wrapperSubscription.getCollection();                    added.addAll(changed);            for ( iter = added.iterator(); iter.hasNext() ; )             {                Diagnosis d = (Diagnosis)iter.next();                                //Find wrapper for this Diagnosis                DiagnosesWrapper dw = findWrapper(d, wrappers);                //runFilters                if (dw != null && runFilters(dw)) {                    this.publishChange(dw);                }                            }                    }               }