code: static Map<String, Object> valueAsMap(Map<String, Object> map, Key key, Map<String, Object> defaultValue) {
          if (map.containsKey(key.key)) {
              Object rawOrMap = map.get(key.key);
              if (rawOrMap instanceof Map) {
                  @SuppressWarnings("unchecked")
                  Map<String, Object> submap = (Map<String, Object>) rawOrMap;
                  return submap;
              } else {
                  return defaultValue;
              }
          }
          return defaultValue;
      }
docs: Fetches a value specified by key
  
  @param map XPP3 map equivalent
  @param key navigation key
  @param defaultValue Default value if no such key exists
  @return Map representation of the value