private Cluster createCluster(int numNodes, String topicName, int partitions) {
        Node[] nodeArray = new Node[numNodes];
        HashMap<Integer, Node> nodes = new HashMap<>();
        for (int i = 0; i < numNodes; ++i) {
            nodeArray[i] = new Node(i, "localhost", 8121 + i);
            nodes.put(i, nodeArray[i]);
        }
        Node leader = nodeArray[0];
        List<PartitionInfo> pInfos = new ArrayList<>();
        for (int i = 0; i < partitions; ++i) {
            pInfos.add(new PartitionInfo(topicName, i, leader, nodeArray, nodeArray));
        }
        return new Cluster(
                "mockClusterId",
                nodes.values(),
                pInfos,
                Collections.emptySet(),
                Collections.emptySet(),
                leader);
    }
TopicAdmin can be used to read the end offsets, but the admin client API used to do this was
added to the broker in 0.11.0.0. This means that if Connect talks to older brokers,
the admin client cannot be used to read end offsets, and will throw an UnsupportedVersionException.
connect/runtime/src/test/java/org/apache/kafka/connect/util/TopicAdminTest.java