public static NodeRef nodeFromPod(Pod pod) {
        return new NodeRef(
                pod.getMetadata().getName(),
                ReconcilerUtils.getPodIndexFromPodName(pod.getMetadata().getName()),
                ReconcilerUtils.getPoolNameFromPodName(clusterNameFromLabel(pod), pod.getMetadata().getName()),
                hasRole(pod, Labels.STRIMZI_CONTROLLER_ROLE_LABEL),
                hasRole(pod, Labels.STRIMZI_BROKER_ROLE_LABEL));
    }
@Test
    public void testNodeRefFromPod() {
        NodeRef node = ReconcilerUtils.nodeFromPod(new PodBuilder()
                .withNewMetadata()
                    .withName("my-cluster-new-brokers-1")
                    .withLabels(Map.of(Labels.STRIMZI_CLUSTER_LABEL, "my-cluster"))
                .endMetadata()
                .build());

        assertThat(node.podName(), is("my-cluster-new-brokers-1"));
        assertThat(node.nodeId(), is(1));
        assertThat(node.poolName(), is("new-brokers"));
        assertThat(node.controller(), is(false));
        assertThat(node.broker(), is(false));

        node = ReconcilerUtils.nodeFromPod(new PodBuilder()
                .withNewMetadata()
                    .withName("my-cluster-new-brokers-1")
                    .withLabels(Map.of(Labels.STRIMZI_CLUSTER_LABEL, "my-cluster", Labels.STRIMZI_CONTROLLER_ROLE_LABEL, "true", Labels.STRIMZI_BROKER_ROLE_LABEL, "false"))
                .endMetadata()
                .build());

        assertThat(node.podName(), is("my-cluster-new-brokers-1"));
        assertThat(node.nodeId(), is(1));
        assertThat(node.poolName(), is("new-brokers"));
        assertThat(node.controller(), is(true));
        assertThat(node.broker(), is(false));

        node = ReconcilerUtils.nodeFromPod(new PodBuilder()
                .withNewMetadata()
                    .withName("my-cluster-new-brokers-1")
                    .withLabels(Map.of(Labels.STRIMZI_CLUSTER_LABEL, "my-cluster", Labels.STRIMZI_CONTROLLER_ROLE_LABEL, "false", Labels.STRIMZI_BROKER_ROLE_LABEL, "true"))
                .endMetadata()
                .build());

        assertThat(node.podName(), is("my-cluster-new-brokers-1"));
        assertThat(node.nodeId(), is(1));
        assertThat(node.poolName(), is("new-brokers"));
        assertThat(node.controller(), is(false));
        assertThat(node.broker(), is(true));
    }