code: public static Method getMethod(Class<?> type, String methodName, Class<?>... parameterTypes) {
  
      try {
        return type.getDeclaredMethod(methodName, parameterTypes);
      }
      catch (NoSuchMethodException cause) {
  
        if (type.getSuperclass() != null) {
          return getMethod(type.getSuperclass(), methodName, parameterTypes);
        }
  
        throw new MethodNotFoundException(cause);
      }
    }
docs: Gets a Method object representing the named method on the specified class.  This method will recursively search
  up the class hierarchy of the specified class until the Object class is reached.  If the named method is found
  then a Method object representing the class method is returned, otherwise a NoSuchMethodException is thrown.
  
  @param type the Class type to search for the specified method.
  @param methodName a String indicating the name of the method on the class.
  @param parameterTypes an array of Class objects identifying the parameters and their types
  based on the method's signature.
  @return a Method object representing the named method on the specified class.
  @throws MethodNotFoundException if the named method does not exist on the specified class
  or a superclass of the specified class.
  @see java.lang.Class
  @see java.lang.Class#getDeclaredMethod(String, Class[])
  @see java.lang.reflect.Method