code: protected boolean nodeMatches(Node node, Class<? extends Node> cls, String uri) {
          if (node.getClass() == cls) {
              return uri == null || NodeUtil.isOriginalURI(node, uri);
          }
  
          return false;
      }
docs: This method determines whether the supplied node matches the specified class
  and optional URI.
  
  @param node The node
  @param cls The class
  @param uri The optional URI
  @return Whether the node is of the correct type and matches the optional URI