code: public static boolean isMethodNode(ASTNode node, String methodNamePattern, Integer numArguments, Class returnType) {
          if (!(node instanceof MethodNode)) {
              return false;
          }
          if (!(((MethodNode) node).getName().matches(methodNamePattern))) {
              return false;
          }
          if (numArguments != null && ((MethodNode)node).getParameters() != null && ((MethodNode)node).getParameters().length != numArguments) {
              return false;
          }
          if (returnType != null && !AstUtil.classNodeImplementsType(((MethodNode) node).getReturnType(), returnType)) {
              return false;
          }
          return true;
      }
docs: Tells you if the ASTNode is a method node for the given name, arity, and return type.
  @param node
  the node to inspect
  @param methodNamePattern
  the expected name of the method
  @param numArguments
  the expected number of arguments, optional
  @param returnType
  the expected return type, optional
  @return
  true if this node is a MethodNode meeting the parameters. false otherwise