code: @SuppressWarnings("unchecked")
    public <T> Optional<T> invoke(Object target) {
      Object resolvedTarget = resolveTarget(target);
      Method method = getMethod();
  
      try {
        return Optional.ofNullable((T) method.invoke(resolvedTarget, getArguments()));
      }
      catch (IllegalAccessException | InvocationTargetException e) {
        throw new MethodInvocationException(String.format("Failed to invoke method [%1$s] on target object [%2$s]",
          method.getName(), resolvedTarget), e);
      }
    }
docs: Invokes the {@link Method} on the given target {@link Object}.
  
  @param <T> {@link Class} type of the {@link Method} return value.
  @param target {@link Object} on which the {@link Method} will be invoked.
  @return the result of the {@link Method} invocation on the given target {@link Object}
  wrapped in a {@link Optional} to guard against {@literal null}.
  @throws MethodInvocationException if an error occurs during the invocation of the {@link Method}
  on the target {@link Object}.
  @see java.lang.reflect.Method#invoke(Object, Object...)
  @see java.util.Optional
  @see #resolveTarget(Object)
  @see #getArguments()
  @see #getMethod()