public static <TNode extends AvlNode> void visit(final TNode root,
      final AvlNodeVisitor<TNode> visitor) {
      if (root == null) return;

      final AvlTreeIterator<TNode> iterator = new AvlTreeIterator<>(root);
      boolean visitNext = true;
      while (visitNext && iterator.hasNext()) {
        visitNext = visitor.visitNode(iterator.next());
      }
    }
Visit each node of the tree
@param root    the current root of the tree
@param visitor the AvlNodeVisitor instance
hbase-common/src/main/java/org/apache/hadoop/hbase/util/AvlUtil.java