docs: private Method getMethod(Class<?> clazz) {
      Method method = null;
      if (methodName != null) {
        method = getPublicMethod(clazz, methodName, methodParams);
        if (method != null
            && returnType != null
            && !returnType.isAssignableFrom(method.getReturnType())) {
  
          // If the return type is non-null it must be compatible.
          method = null;
        }
      }
      return method;
    }