LOGGER.debug("{} - currentLeader: {}", clusterManager.localNode(), leader);
}
if (currentLeader == null && leader != null) {
currentLeader = leader;
events.leaderElect().handle(new LeaderElectEvent(currentTerm, clusterManager.node(currentLeader).member()));
} else if (currentLeader != null && leader != null && !currentLeader.equals(leader)) {
currentLeader = leader;
events.leaderElect().handle(new LeaderElectEvent(currentTerm, clusterManager.node(currentLeader).member()));
} else {
currentLeader = leader;
}
return this;
}