code: public static <T> void wrapMethod(T object, String methodName,
        AfterMethodCall<T> afterMethodCall) {
      Function method = (Function) ((JsPropertyMap) object).get(methodName);
  
      WrappingFunction wrappingFunction = args -> {
        Object result = method.apply(object, args);
        afterMethodCall.execute(object, methodName, result, args);
        return result;
      };
  
      ((JsPropertyMap) object).set(methodName, wrappingFunction);
    }
docs: Proxy a method call to be warned when it called. This requires the function to be JsInterop
  (name shouldn't change at runtime). This used to observe Java Collections/Map. It won't be
  necessary in future versions of Vue.js based on ES6 proxies.
  
  @param object The object to observe
  @param methodName The name of the method to proxify
  @param afterMethodCall A callback called each time after the method has been executed
  @param <T> Type of the object the we Proxy