code: public <Instance> Instance createInstance(InvocationHandler invocationHandler, CompositeType compositeType) {
          Class<?>[] classes = compositeType.getClasses();
          Constructor<?> constructor = classCache.getIfPresent(compositeType);
          if (constructor == null) {
              Class<?> type;
              try {
                  type = Proxy.getProxyClass(classLoader, classes);
              } catch (IllegalArgumentException e) {
                  throw new XOException("Cannot create proxy for " + compositeType + " of classes " + compositeType.getClasses(), e);
              }
              try {
                  constructor = type.getConstructor(new Class<?>[] { InvocationHandler.class });
              } catch (NoSuchMethodException e) {
                  throw new XOException("Cannot find constructor for " + compositeType, e);
              }
              classCache.put(compositeType, constructor);
          }
          Instance instance;
          try {
              instance = (Instance) constructor.newInstance(invocationHandler);
          } catch (Exception e) {
              throw new XOException("Cannot create instance of  " + compositeType, e);
          }
          return interceptorFactory.addInterceptor(instance, classes);
      }
docs: Creates a proxy instance.
  
  @param invocationHandler
  The {@link java.lang.reflect.InvocationHandler}.
  @param compositeType
  The composite type to create an instance for.
  @param <Instance>
  The instance type.
  @return The instance.