@Override
    public void close() {
        try {
            lock.lock();

            idempotentCloser.close(
                    () -> retainAll(Collections.emptySet()),
                    () -> log.warn("The fetch buffer was already closed")
            );
        } finally {
            lock.unlock();
        }
    }
Return the set of {@link TopicPartition partitions} for which we have data in the buffer.

@return {@link TopicPartition Partition} set
clients/src/main/java/org/apache/kafka/clients/consumer/internals/FetchBuffer.java