code: public static <T> void setBeanInstance(String contextId, T proxy, BeanInstance beanInstance, Bean<?> bean) {
          if (proxy instanceof ProxyObject) {
              ProxyObject proxyView = (ProxyObject) proxy;
              proxyView.weld_setHandler(new ProxyMethodHandler(contextId, beanInstance, bean));
          }
      }
docs: Convenience method to set the underlying bean instance for a proxy.
  
  @param proxy        the proxy instance
  @param beanInstance the instance of the bean