private boolean checkIfStageComplete(Collection changedRootTasks) {
private boolean checkIfStageComplete(Collection changedRootTaskPlanElements) {
  private boolean checkIfStageComplete(Collection changedRootTasks) {    double confidence = 0;    if (changedRootTasks.size() > 1 ) {      logger.error("GLSInitServlet: More than 1 root task of a certain type." );    }    for (Iterator i = changedRootTasks.iterator(); i.hasNext(); ) {      PlanElement pe = (PlanElement) i.next();      AllocationResult ar = null;      if (pe != null) {        ar = pe.getEstimatedResult();        confidence = ar.getConfidenceRating();        if (logger.isDebugEnabled()) {          switch (myPrivateState.listening_to) {          case LISTENING_TO_NOTHING:            logger.debug("checkIfStageComplete():  State is LISTENING_TO_NOTHING");          break;          case LISTENING_TO_PROP_REG_SRVCS:            logger.debug("checkIfStageComplete():  State is LISTENING_TO_PROP_REG_SRVCS");          break;          case LISTENING_TO_PROP_FIND_PROV:            logger.debug("checkIfStageComplete():  State is LISTENING_TO_PROP_FIND_PROV");          break;          case LISTENING_TO_GLS:            logger.debug("checkIfStageComplete():  State is LISTENING_TO_GLS");          break;          } //end switch          logger.debug("GLSInitServlet: changed task is " +pe.getTask());          logger.debug("GLSInitServlet: confidence of changed task - " +confidence );        }      }      if (confidence >= 1.0){        //ready to move to next stage        if (logger.isDebugEnabled()) {          logger.debug("GLSInitServlet: Stage is Complete- Confidence is- " +confidence +"\n");        }        return true;      }    }    return false;  }