private Set<TopicPartition> fetchablePartitions() {
        // This is the set of partitions we have in our buffer
        Set<TopicPartition> buffered = fetchBuffer.bufferedPartitions();

        // This is the test that returns true if the partition is *not* buffered
        Predicate<TopicPartition> isNotBuffered = tp -> !buffered.contains(tp);

        // Return all partitions that are in an otherwise fetchable state *and* for which we don't already have some
        // messages sitting in our buffer.
        return new HashSet<>(subscriptions.fetchablePartitions(isNotBuffered));
    }
Return the list of <em>fetchable</em> partitions, which are the set of partitions to which we are subscribed,
but <em>excluding</em> any partitions for which we still have buffered data. The idea is that since the user
has yet to process the data for the partition that has already been fetched, we should not go send for more data
until the previously-fetched data has been processed.

@return {@link Set} of {@link TopicPartition topic partitions} for which we should fetch data
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractFetch.java