private static boolean isEmptyConsumerGroup(Group group) {
        return group != null && group.type() == CONSUMER && group.isEmpty();
    }
@return true if the group is an empty consumer group.
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java