public static void checkInvalidArgsSet(OptionParser parser,
                                           OptionSet options,
                                           Set<OptionSpec<?>> usedOptions,
                                           Set<OptionSpec<?>> invalidOptions,
                                           Optional<String> trailingAdditionalMessage) {
        if (usedOptions.stream().filter(options::has).count() == usedOptions.size()) {
            for (OptionSpec<?> arg : invalidOptions) {
                if (options.has(arg)) {
                    printUsageAndExit(parser, String.format("Option combination \"%s\" can't be used with option \"%s\"%s",
                            usedOptions, arg, trailingAdditionalMessage.orElse("")));
                }
            }
        }
    }
Check that none of the listed options are present with the combination of used options.
server-common/src/main/java/org/apache/kafka/server/util/CommandLineUtils.java