@Test
    public void testFetcherDontCacheAnyData() {
        short version = 17;
        FetchResponse fetchResponse = fetchResponse(tidp0, records, Errors.NONE, 100L, -1L, 0L, 0);
        LinkedHashMap<TopicPartition, FetchResponseData.PartitionData> responseData = fetchResponse.responseData(topicNames, version);
        assertEquals(topicNames.size(), responseData.size());
        responseData.forEach((topicPartition, partitionData) -> assertEquals(records, partitionData.records()));
        LinkedHashMap<TopicPartition, FetchResponseData.PartitionData> nonResponseData = fetchResponse.responseData(emptyMap(), version);
        assertEquals(emptyMap().size(), nonResponseData.size());
        nonResponseData.forEach((topicPartition, partitionData) -> assertEquals(MemoryRecords.EMPTY, partitionData.records()));
    }
Test the scenario that FetchResponse returns with an error indicating leadership change for the partition, along with
new leader info(defined in KIP-951).
clients/src/test/java/org/apache/kafka/clients/consumer/internals/FetcherTest.java