public KafkaMetadataState computeNextMetadataState(KafkaStatus kafkaStatus) {
        KafkaMetadataState currentState = metadataState;
        metadataState = switch (currentState) {
            case KRaft -> onKRaft(kafkaStatus);
            case ZooKeeper -> onZooKeeper(kafkaStatus);
            case KRaftMigration -> onKRaftMigration(kafkaStatus);
            case KRaftDualWriting -> onKRaftDualWriting(kafkaStatus);
            case KRaftPostMigration -> onKRaftPostMigration(kafkaStatus);
            case PreKRaft -> onPreKRaft(kafkaStatus);
        };
        if (metadataState != currentState) {
            LOGGER.infoCr(reconciliation, "Transitioning metadata state from [{}] to [{}] with strimzi.io/kraft annotation [{}]", currentState, metadataState, kraftAnno);
        } else {
            LOGGER.debugCr(reconciliation, "Metadata state [{}] with strimzi.io/kraft annotation [{}]", metadataState, kraftAnno);
        }
        return metadataState;
    }
@Test
    public void testWarningInKRaftDualWriting() {
        Kafka kafka = new KafkaBuilder(KAFKA)
                .editMetadata()
                    .addToAnnotations(Annotations.ANNO_STRIMZI_IO_KRAFT, "enabled")
                .endMetadata()
                .withNewStatus()
                    .withKafkaMetadataState(KRaftDualWriting)
                .endStatus()
                .build();

        KafkaMetadataStateManager kafkaMetadataStateManager = new KafkaMetadataStateManager(Reconciliation.DUMMY_RECONCILIATION, kafka);
        kafkaMetadataStateManager.computeNextMetadataState(kafka.getStatus());
        assertTrue(kafka.getStatus().getConditions().stream().anyMatch(condition -> "KafkaMetadataStateWarning".equals(condition.getReason())));
        assertEquals(kafka.getStatus().getConditions().get(0).getMessage(),
                "The strimzi.io/kraft annotation can't be set to 'enabled' during a migration process. " +
                        "It has to be used in post migration to finalize it and move definitely to KRaft.");

        kafka = new KafkaBuilder(KAFKA)
                .editMetadata()
                    .addToAnnotations(Annotations.ANNO_STRIMZI_IO_KRAFT, "rollback")
                .endMetadata()
                .withNewStatus()
                    .withKafkaMetadataState(KRaftDualWriting)
                .endStatus()
                .build();

        kafkaMetadataStateManager = new KafkaMetadataStateManager(Reconciliation.DUMMY_RECONCILIATION, kafka);
        kafkaMetadataStateManager.computeNextMetadataState(kafka.getStatus());
        assertTrue(kafka.getStatus().getConditions().stream().anyMatch(condition -> "KafkaMetadataStateWarning".equals(condition.getReason())));
        assertEquals(kafka.getStatus().getConditions().get(0).getMessage(),
                "The strimzi.io/kraft annotation can't be set to 'rollback' during dual writing. " +
                        "It can be used in post migration to start rollback process.");
    }