public boolean isLeader(String memberId) {
        return leaderId.map(id -> id.equals(memberId)).orElse(false);
    }
Used to identify whether the given member is the leader of this group.

@param memberId the member id.
@return true if the member is the leader, false otherwise.
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/classic/ClassicGroup.java