code: public int depth(Tree node) {
          Tree p = node.parent(this);
          if (this == node) {
              return 0;
          }
          if (p == null) {
              return -1;
          }
          int depth = 1;
          while (this != p) {
              p = p.parent(this);
              depth++;
          }
          return depth;
      }
docs: Returns the distance between this node
  and the specified subnode
  @param node the node to get the distance from
  @return the distance between the 2 nodes