public String generateMemberId(String clientId, Optional<String> groupInstanceId) {
        return groupInstanceId.map(s -> s + MEMBER_ID_DELIMITER + UUID.randomUUID())
            .orElseGet(() -> clientId + MEMBER_ID_DELIMITER + UUID.randomUUID());
    }
Generate a member id from the given client and group instance ids.

@param clientId         the client id.
@param groupInstanceId  the group instance id.
@return the generated id.
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/classic/ClassicGroup.java