private Collection<String> findChangedKeys(Cluster cluster, String type,
                                             Collection<String> desiredTags, Collection<String> actualTags) {

    Map<String, String> desiredValues = new HashMap<>();
    Map<String, String> actualValues = new HashMap<>();

    for (String tag : desiredTags) {
      Config config = cluster.getConfig(type, tag);
      if (null != config) {
        desiredValues.putAll(config.getProperties());
      }
    }

    for (String tag : actualTags) {
      Config config = cluster.getConfig(type, tag);
      if (null != config) {
        actualValues.putAll(config.getProperties());
      }
    }

    List<String> keys = new ArrayList<>();

    for (Entry<String, String> entry : desiredValues.entrySet()) {
      String key = entry.getKey();
      String value = entry.getValue();

      if (!actualValues.containsKey(key) || !valuesAreEqual(actualValues.get(key), value)) {
        keys.add(type + "/" + key);
      }
    }

    // check for case configs were removed
    for (String key : actualValues.keySet()) {
      if (!desiredValues.containsKey(key)) {
        keys.add(type + "/" + key);
      }
    }

    return keys;
  }
@return the keys that have changed values
ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java