public static KafkaRebalanceState rebalanceState(KafkaRebalanceStatus kafkaRebalanceStatus) {
        if (kafkaRebalanceStatus != null) {
            Condition rebalanceStateCondition = rebalanceStateCondition(kafkaRebalanceStatus);
            String statusString = rebalanceStateCondition != null ? rebalanceStateCondition.getType() : null;
            if (statusString != null) {
                return KafkaRebalanceState.valueOf(statusString);
            }
        }
        return null;
    }
@Test
    public void testValidSingleState() {
        KafkaRebalanceStatus kafkaRebalanceStatus = new KafkaRebalanceStatusBuilder()
                .withConditions(
                        new ConditionBuilder()
                                .withType(KafkaRebalanceState.Rebalancing.toString())
                                .withStatus("True")
                                .build())
                .build();

        KafkaRebalanceState state = KafkaRebalanceUtils.rebalanceState(kafkaRebalanceStatus);
        assertThat(state, is(KafkaRebalanceState.Rebalancing));
    }