code: public Object setMetadata(ITree node, String key, Object value) {
          if (node == null)
              return setMetadata(key, value);
          else {
              Object res = node.setMetadata(key, value);
              if (res == null)
                  return getMetadata(key);
              return res;
          }
      }
docs: Store a local metadata
  
  @param key   of the metadata
  @param value of the metadata
  @return the previous value of metadata if existed or null