code: public static Object invokeMethod(final Object object, final Class<?> clazz, final String methodName,
              final Object... arguments) throws Exception {
  
          Class<?> superClazz = clazz;
  
          while (superClazz != null) {
              for (final Method declaredMethod : superClazz.getDeclaredMethods()) {
                  if (declaredMethod.getName().equals(methodName)) {
                      final Class<?>[] parameterTypes = declaredMethod.getParameterTypes();
  
                      if (parameterTypes.length == arguments.length && checkArguments(parameterTypes, arguments)) {
                          return invokeMethod(declaredMethod, object, arguments);
                      }
                  }
              }
  
              superClazz = superClazz.getSuperclass();
          }
  
          throw new IllegalArgumentException("Method " + methodName + ":" + Arrays.toString(arguments) + " not found");
      }
docs: Invoke a given method with given arguments on a given object via
  reflection.
  
  @param object
  -- target object of invocation
  @param clazz
  -- type of argument object
  @param methodName
  -- name of method to be invoked
  @param arguments
  -- arguments for method invocation
  @return -- method object to which invocation is actually dispatched
  @throws Exception
  - operation exception