code: public static Object invokeMethod(final Object object, final boolean forceAccess, final String methodName,
              Object[] args, Class<?>[] parameterTypes)
              throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
          parameterTypes = ArrayUtils.nullToEmpty(parameterTypes);
          args = ArrayUtils.nullToEmpty(args);
  
          final String messagePrefix;
          Method method = null;
  
          if (forceAccess) {
              messagePrefix = "No such method: ";
              method = getMatchingMethod(object.getClass(),
                      methodName, parameterTypes);
              if (method != null && !method.isAccessible()) {
                  method.setAccessible(true);
              }
          } else {
              messagePrefix = "No such accessible method: ";
              method = getMatchingAccessibleMethod(object.getClass(),
                      methodName, parameterTypes);
          }
  
          if (method == null) {
              throw new NoSuchMethodException(messagePrefix
                      + methodName + "() on object: "
                      + object.getClass().getName());
          }
          args = toVarArgs(method, args);
  
          return method.invoke(object, args);
      }
docs: <p>Invokes a named method whose parameter type matches the object type.</p>
  
  <p>This method supports calls to methods taking primitive parameters
  via passing in wrapping classes. So, for example, a {@code Boolean} object
  would match a {@code boolean} primitive.</p>
  
  @param object invoke method on this object
  @param forceAccess force access to invoke method even if it's not accessible
  @param methodName get method with this name
  @param args use these arguments - treat null as empty array
  @param parameterTypes match these parameters - treat null as empty array
  @return The value returned by the invoked method
  
  @throws NoSuchMethodException if there is no such accessible method
  @throws InvocationTargetException wraps an exception thrown by the method invoked
  @throws IllegalAccessException if the requested method is not accessible via reflection
  @since 3.5