if (thisAgent.equals(preferredLeader())) {
if (isLeader(thisAgent)) {
  public void execute() {    if ((wakeAlarm != null) &&        ((wakeAlarm.hasExpired()))) {      if (thisAgent.equals(preferredLeader())) {        logger.info(statusSummary());        checkCommunityReady();        checkLoadBalance();      }      wakeAlarm = new WakeAlarm((new Date()).getTime() + STATUS_INTERVAL);      alarmService.addRealTimeAlarm(wakeAlarm);    }  }