} else if (name.equals(preferredLeader()) && isLeader(thisAgent)) { newState(name, RESTART);
    public void enter(String name) {      //int priorState = model.getpriorState(name);      //if (priorState == DECONFLICT || priorState == RESTART) {      //  newState(name, priorState);      //} else {      logger.info("New state (DEAD):" +                  " name=" + name +                  " preferredLeader=" + thisAgent.equals(preferredLeader()) +                  " isAgent=" + isAgent(name));      communityReady = false; // For ACME Community Ready Events      if (isAgent(name) && thisAgent.equals(preferredLeader())) {        // Interface point for Deconfliction        // If Ok'd by Deconflictor set state to RESTART        if(isDeconflictionEnabled()) {          newState(name, DECONFLICT);        } else {          newState(name, RESTART);        }      } else if (isNode(name) && thisAgent.equals(preferredLeader())) {        removeFromCommunity(name);        setExpiration(name, NEVER);        deadNodes.add(name);        String agentsOnDeadNode[] = model.entitiesAtLocation(name, model.AGENT);        for (int i = 0; i < agentsOnDeadNode.length; i++) {          newState(agentsOnDeadNode[i], HEALTH_CHECK);        }        if (thisAgent.equals(preferredLeader()) && useGlobalSolver()) {          LoadBalancerListener lbl = new LoadBalancerListener() {            public void layoutReady(Map layout) {              logger.info("layout from EN4J: " + layout);              RestartDestinationLocator.setPreferredRestartLocations(layout);            }          };          getLayout(lbl);        }      }      if (isLocal(name)) {        stopHeartbeats(name);      }    }