private DescribeClusterResponse describeClusterResponse(Cluster cluster) {
        DescribeClusterResponseData data = new DescribeClusterResponseData()
            .setErrorCode(Errors.NONE.code())
            .setThrottleTimeMs(0)
            .setControllerId(cluster.nodes().get(0).id())
            .setClusterId(cluster.clusterResource().clusterId())
            .setClusterAuthorizedOperations(MetadataResponse.AUTHORIZED_OPERATIONS_OMITTED);

        cluster.nodes().forEach(broker ->
            data.brokers().add(new DescribeClusterResponseData.DescribeClusterBroker()
                .setHost(broker.host())
                .setPort(broker.port())
                .setBrokerId(broker.id())
                .setRack(broker.rack())));

        return new DescribeClusterResponse(data);
    }
Create a ListOffsetResponse that exposes the supplied error and includes offsets for the supplied partitions.
@param error               the error; may be null if an unknown error should be used
@param offsetsByPartitions offset for each partition, where offset is null signals the error should be used
@return the response
connect/runtime/src/test/java/org/apache/kafka/connect/util/TopicAdminTest.java