public SortedMap<String, SortedMap<String, String>> sortConfigutations(Map<String, Map<String, String>> configurations) {
    SortedMap<String, SortedMap<String, String>> configurationsTreeMap = new TreeMap<>();
    configurations.forEach((k, v) -> configurationsTreeMap.put(k, new TreeMap<>(v)));
    return configurationsTreeMap;
  }
Collects actual configurations and configuration attributes for specified host.
@param hostId host id to collect configurations and configuration attributes
@return event ready to send to agent
@throws AmbariException
ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java