cluster/hazelcast/src/main/java/de/taimos/dvalin/cluster/hazelcast/LeaderElection.java
/**
     * @return true if the current node is the leader of the cluster
     */
@return true if the current node is the leader of the cluster
@return true if the current node is the leader of the cluster
public boolean isLeader() {
        Cluster cluster = this.hazelcastInstance.getCluster();
        String localUuid = cluster.getLocalMember().getUuid();
        return cluster.getMembers().stream()
            .map(Member::getUuid)
            .min(String::compareTo)
            .filter(Predicate.isEqual(localUuid))
            .isPresent();
    }
public boolean isLeader ( ) { Cluster cluster = this . hazelcastInstance . getCluster ( ) ; String localUuid = cluster . getLocalMember ( ) . getUuid ( ) ; return cluster . getMembers ( ) . stream ( ) . map ( Member :: getUuid ) . min ( String :: compareTo ) . filter ( Predicate . isEqual ( localUuid ) ) . isPresent ( ) ; }
@return true if the current node is the leader of the cluster
@return true if the current node is the leader of the cluster