@Override
    public String toString() {
        return data.toString();
    }
@Test
    public void testToString() {
        for (short version : LEADER_AND_ISR.allVersions()) {
            LeaderAndIsrResponse response;
            if (version < 5) {
                List<LeaderAndIsrPartitionError> partitions = createPartitions("foo",
                        asList(Errors.NONE, Errors.CLUSTER_AUTHORIZATION_FAILED));
                response = new LeaderAndIsrResponse(new LeaderAndIsrResponseData()
                        .setErrorCode(Errors.NONE.code())
                        .setPartitionErrors(partitions), version);
                String responseStr = response.toString();
                assertTrue(responseStr.contains(LeaderAndIsrResponse.class.getSimpleName()));
                assertTrue(responseStr.contains(partitions.toString()));
                assertTrue(responseStr.contains("errorCode=" + Errors.NONE.code()));

            } else {
                Uuid id = Uuid.randomUuid();
                LeaderAndIsrTopicErrorCollection topics = createTopic(id, asList(Errors.NONE, Errors.CLUSTER_AUTHORIZATION_FAILED));
                response = new LeaderAndIsrResponse(new LeaderAndIsrResponseData()
                        .setErrorCode(Errors.NONE.code())
                        .setTopics(topics), version);
                String responseStr = response.toString();
                assertTrue(responseStr.contains(LeaderAndIsrResponse.class.getSimpleName()));
                assertTrue(responseStr.contains(topics.toString()));
                assertTrue(responseStr.contains(id.toString()));
                assertTrue(responseStr.contains("errorCode=" + Errors.NONE.code()));
            }
        }
    }