code: public boolean matches(final Node node) throws IllegalArgumentException {
          // Precondition checks
          if (node == null) {
              throw new IllegalArgumentException("node must be specified");
          }
  
          if (!name.equals(node.getName())) {
              return false;
          }
  
          if ((text != null && node.getText() == null) || (text != null && !text.trim().equals(node.getText().trim()))) {
              return false;
          }
  
          if (attributes != null) {
              for (final Map.Entry<String, String> attribute : attributes.entrySet()) {
                  final String attrValue = attribute.getValue();
                  final String attrName = attribute.getKey();
  
                  if (!attrValue.equals(node.getAttribute(attrName))) {
                      return false;
                  }
              }
          }
  
          return true;
      }
docs: Returns true if and only if the specified {@link Node} values match the data contained in this {@link Pattern}
  value object
  
  @param node
  @return
  @throws IllegalArgumentException
  If the {@link Node} is not specified