code: @Unstable
      public long indexOf(Block child)
      {
          CounterBlockMatcher counter = new CounterBlockMatcher(child);
  
          Block found = getFirstBlock(counter, Axes.ANCESTOR_OR_SELF);
  
          return found != null ? counter.getCount() : -1;
      }
docs: Find the index of the block in the tree.
  
  @param child the block for which to find the index
  @return the index of the passed block in the tree, 0 is the current block and -1 means that it was not found
  @since 10.10RC1