newState(preferredLeader(), RESTART); } if (thisAgent.equals(preferredLeader()) && startupCompleted && wasRestarted) { pingAll();
  public void leaderChange(String priorLeader, String newLeader) {    logger.info("LeaderChange: prior=" + priorLeader + " new=" + newLeader);    if (isLeader(thisAgent) && model.getCurrentState(preferredLeader()) == DEAD) {      newState(preferredLeader(), RESTART);    }    if (thisAgent.equals(preferredLeader()) && startupCompleted && wasRestarted) {      pingAll();    }    checkCommunityReady();  }