public static <TNode extends AvlNode> TNode get(TNode root, final Object key,
      final AvlKeyComparator<TNode> keyComparator) {
      while (root != null) {
        int cmp = keyComparator.compareKey(root, key);
        if (cmp > 0) {
          root = (TNode) root.avlLeft;
        } else if (cmp < 0) {
          root = (TNode) root.avlRight;
        } else {
          return (TNode) root;
        }
      }
      return null;
    }
Return the node that matches the specified key or null in case of node not found.
@param root          the current root of the tree
@param key           the key for the node we are trying to find
@param keyComparator the comparator to use to match node and key
@return the node that matches the specified key or null in case of node not found.
hbase-common/src/main/java/org/apache/hadoop/hbase/util/AvlUtil.java