code: @Override
      public <T> T createContextualProxy(ThreadContextDescriptor threadContextDescriptor, T instance, final Class<T> intf) {
          if (intf == null || !intf.isInstance(instance))
              throw new IllegalArgumentException(instance + ", " + (intf == null ? null : intf.getName()));
  
          if (Callable.class.equals(intf)) {
              @SuppressWarnings("unchecked")
              Callable<Object> callable = (Callable<Object>) instance;
              instance = intf.cast(new ContextualCallable<Object>(threadContextDescriptor, callable, null));
          } else if (Runnable.class.equals(intf)) {
              instance = intf.cast(new ContextualRunnable(threadContextDescriptor, (Runnable) instance, null));
          } else {
              final InvocationHandler handler = new ContextualInvocationHandler(threadContextDescriptor, instance, null);
              instance = AccessController.doPrivileged(new PrivilegedAction<T>() {
                  @Override
                  public T run() {
                      return intf.cast(Proxy.newProxyInstance(intf.getClassLoader(), new Class<?>[] { intf }, handler));
                  }
              });
          }
          return instance;
      }
docs: {@inheritDoc}