code: static int getNameReferenceCount(Node node, String name) {
      return getCount(node, new MatchNameNode(name), Predicates.alwaysTrue());
    }
docs: Finds the number of times a simple name is referenced within the node tree.