public static void maybeUpdateConfig(Set<AlterConfigOp> configsToAlter,
                                         Map<String, String> configsToSet,
                                         Config currentConfig) {
        for (Map.Entry<String, String> entry : configsToSet.entrySet()) {
            String configName = entry.getKey();
            String targetConfigValue = entry.getValue();
            if (currentConfig.get(configName) == null || !currentConfig.get(configName).value().equals(targetConfigValue)) {
                configsToAlter.add(new AlterConfigOp(new ConfigEntry(configName, targetConfigValue), AlterConfigOp.OpType.SET));
            }
        }
    }
Create a config altering operation if config's current value does not equal to target value.

@param configsToAlter Set of config altering operations to be applied.
@param configsToSet   Configs to set.
@param currentConfig  Current value of the config.
core/src/main/java/kafka/autobalancer/metricsreporter/AutoBalancerMetricsUtils.java