public List<ConsumerRecord<K, V>> records(TopicPartition partition) {
        List<ConsumerRecord<K, V>> recs = this.records.get(partition);
        if (recs == null)
            return Collections.emptyList();
        else
            return Collections.unmodifiableList(recs);
    }
Get just the records for the given partition

@param partition The partition to get records for
clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerRecords.java