private void updateGroupMetadata(final Optional<Integer> memberEpoch, final Optional<String> memberId) {
        groupMetadata.updateAndGet(
            oldGroupMetadataOptional -> oldGroupMetadataOptional.map(
                oldGroupMetadata -> new ConsumerGroupMetadata(
                    oldGroupMetadata.groupId(),
                    memberEpoch.orElse(oldGroupMetadata.generationId()),
                    memberId.orElse(oldGroupMetadata.memberId()),
                    oldGroupMetadata.groupInstanceId()
                )
            )
        );
    }
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