@Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Cluster cluster = (Cluster) o;
        return isBootstrapConfigured == cluster.isBootstrapConfigured &&
                Objects.equals(nodes, cluster.nodes) &&
                Objects.equals(unauthorizedTopics, cluster.unauthorizedTopics) &&
                Objects.equals(invalidTopics, cluster.invalidTopics) &&
                Objects.equals(internalTopics, cluster.internalTopics) &&
                Objects.equals(controller, cluster.controller) &&
                Objects.equals(partitionsByTopicPartition, cluster.partitionsByTopicPartition) &&
                Objects.equals(clusterResource, cluster.clusterResource) &&
                Objects.equals(topicIds, cluster.topicIds);
    }
@Test
    public void testEquals() {
        String clusterId1 = "clusterId1";
        Node node1 = new Node(1, "host0", 100);
        Node node1duplicate = new Node(1, "host0", 100);
        Set<PartitionInfo> partitions1 = Collections.singleton(new PartitionInfo("topic1", 0, node1, new Node[]{node1}, new Node[]{node1}));
        Set<PartitionInfo> partitions1duplicate = Collections.singleton(new PartitionInfo("topic1", 0, node1duplicate, new Node[]{node1duplicate}, new Node[]{node1duplicate}));
        Set<String> unauthorizedTopics1 = Collections.singleton("topic1");
        Set<String> invalidTopics1 = Collections.singleton("topic1");
        Set<String> internalTopics1 = Collections.singleton("topic3");
        Node controller1 = new Node(2, "host0", 100);
        Node controller1duplicate = new Node(2, "host0", 100);
        Uuid topicId1 = Uuid.randomUuid();
        Map<String, Uuid> topicIds1 = Collections.singletonMap("topic1", topicId1);
        Map<String, Uuid> topicIds1duplicate = Collections.singletonMap("topic1", topicId1);

        Cluster cluster1 = new Cluster(clusterId1, Collections.singletonList(node1), partitions1, unauthorizedTopics1,
            invalidTopics1, internalTopics1, controller1, topicIds1);
        Cluster cluster1duplicate = new Cluster(clusterId1, Collections.singletonList(node1duplicate), partitions1duplicate,
            unauthorizedTopics1, invalidTopics1, internalTopics1, controller1duplicate, topicIds1duplicate);
        assertEquals(cluster1, cluster1duplicate);
    }