code: public static boolean respondsTo(Object object, String methodName) {
          MetaClass metaClass = DefaultGroovyMethods.getMetaClass(object);
          if (!metaClass.respondsTo(object, methodName).isEmpty()) {
              return true;
          }
          Map properties = DefaultGroovyMethods.getProperties(object);
          return properties.containsKey(methodName);
      }
docs: Return true only if the specified object responds to the named method
  @param object - the object to check
  @param methodName - the name of the method
  @return true if the object responds to the named method