public void validate(OptionRule rule) {
        List<RequiredOption> requiredOptions = rule.getRequiredOptions();
        for (RequiredOption requiredOption : requiredOptions) {
            validate(requiredOption);

            for (Option<?> option : requiredOption.getOptions()) {
                if (SingleChoiceOption.class.isAssignableFrom(option.getClass())) {
                    // is required option and not match condition, skip validate
                    if (isConditionOption(requiredOption)
                            && !matchCondition(
                                    (RequiredOption.ConditionalRequiredOptions) requiredOption)) {
                        continue;
                    }
                    validateSingleChoice(option);
                }
            }
        }

        for (Option option : rule.getOptionalOptions()) {
            if (SingleChoiceOption.class.isAssignableFrom(option.getClass())) {
                validateSingleChoice(option);
            }
        }
    }
@Test
    public void testSimpleExclusiveRequiredOptions() {
        OptionRule rule = OptionRule.builder().exclusive(TEST_TOPIC_PATTERN, TEST_TOPIC).build();
        Map<String, Object> config = new HashMap<>();
        Executable executable = () -> validate(config, rule);

        // all absent
        assertEquals(
                "ErrorCode:[API-02], ErrorDescription:[Option item validate failed] - There are unconfigured options, these options('option.topic-pattern', 'option.topic') are mutually exclusive,"
                        + " allowing only one set(\"[] for a set\") of options to be configured.",
                assertThrows(OptionValidationException.class, executable).getMessage());

        // only one present
        config.put(TEST_TOPIC_PATTERN.key(), "asuka");
        Assertions.assertDoesNotThrow(executable);

        // present > 1
        config.put(TEST_TOPIC.key(), "[\"saitou\"]");
        assertEquals(
                "ErrorCode:[API-02], ErrorDescription:[Option item validate failed] - These options('option.topic-pattern', 'option.topic') are mutually exclusive, "
                        + "allowing only one set(\"[] for a set\") of options to be configured.",
                assertThrows(OptionValidationException.class, executable).getMessage());
    }