private Object transform(String key, Object o) {
    Object transformedData = null;

    if (key != null) {
      if (o instanceof Map) {
        Map<?, ?> data = (Map) o;

        if (data.containsKey(key)) {
          transformedData = data.get(key);
        } else {
          // See if the key implies a tree that needs to be traversed...
          // For example:  configurations/service-conf/property_name
          //  A map of maps is expected such that the top level map has a map identified by the key
          //  of "configuration".  The "configuration" map has a map identified by the key of
          // "service-conf". The "service-conf" has a value identified by the key of "property_name".
          String[] parts = key.split("\\/", 2);

          // If only a single item is returned, than the key does not indicate a tree.
          if (parts.length == 2) {
            // If the first item is empty, a leading "/" was encountered... retry with the pruned key
            if (parts[0].isEmpty()) {
              transformedData = transform(parts[1], o);
            } else {
              transformedData = transform(parts[1], data.get(parts[0]));
            }
          }
        }
      }
    }

    return transformedData;
  }
Traverses the input object (expected to be a {@link Map}) to find the data associated with
the specified key.
<p>
Note: This method is recursive in the even the key represents a path

@param key the key to search for
@param o   the object containing data to process
@return the found data or null
ambari-server/src/main/java/org/apache/ambari/server/collections/functors/ContextTransformer.java