private Optional<ConsumerGroupMetadata> initializeGroupMetadata(final String groupId,
                                                                    final Optional<String> groupInstanceId) {
        if (groupId != null) {
            if (groupId.isEmpty()) {
                throw new InvalidGroupIdException("The configured " + ConsumerConfig.GROUP_ID_CONFIG
                    + " should not be an empty string or whitespace.");
            } else {
                return Optional.of(initializeConsumerGroupMetadata(groupId, groupInstanceId));
            }
        }
        return Optional.empty();
    }
A thread-safe {@link FetchBuffer fetch buffer} for the results that are populated in the
{@link ConsumerNetworkThread network thread} when the results are available. Because of the interaction
of the fetch buffer in the application thread and the network I/O thread, this is shared between the
two threads and is thus designed to be thread-safe.
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java