private CompletableFuture<Void> enqueueConsumerRebalanceListenerCallback(ConsumerRebalanceListenerMethodName methodName,
                                                                             Set<TopicPartition> partitions) {
        SortedSet<TopicPartition> sortedPartitions = new TreeSet<>(TOPIC_PARTITION_COMPARATOR);
        sortedPartitions.addAll(partitions);

        CompletableBackgroundEvent<Void> event = new ConsumerRebalanceListenerCallbackNeededEvent(methodName, sortedPartitions);
        backgroundEventHandler.add(event);
        log.debug("The event to trigger the {} method execution was enqueued successfully", methodName.fullyQualifiedMethodName());
        return event.future();
    }
Enqueue a {@link ConsumerRebalanceListenerCallbackNeededEvent} to trigger the execution of the
appropriate {@link ConsumerRebalanceListener} {@link ConsumerRebalanceListenerMethodName method} on the
application thread.

<p/>

Because the reconciliation process (run in the background thread) will be blocked by the application thread
until it completes this, we need to provide a {@link CompletableFuture} by which to remember where we left off.

@param methodName Callback method that needs to be executed on the application thread
@param partitions Partitions to supply to the callback method
@return Future that will be chained within the rest of the reconciliation logic
clients/src/main/java/org/apache/kafka/clients/consumer/internals/MembershipManagerImpl.java