private CreateTopicsResponse createTopicResponse(ApiError error, NewTopic... topics) {
        if (error == null) error = new ApiError(Errors.NONE, "");
        CreateTopicsResponseData response = new CreateTopicsResponseData();
        for (NewTopic topic : topics) {
            response.topics().add(new CreatableTopicResult().
                setName(topic.name()).
                setErrorCode(error.error().code()).
                setErrorMessage(error.message()));
        }
        return new CreateTopicsResponse(response);
    }
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