code: public Object getMetadata(ITree node, String key) {
          Object metadata;
          if (node == null || (metadata = node.getMetadata(key)) == null)
              return getMetadata(key);
          return metadata;
      }
docs: Get a local metadata, if available. Otherwise get a global metadata.
  There is no way to know if the metadata is really null or does not exists.
  
  @param key of metadata
  @return the metadata or null if not found