code: @SuppressWarnings("unchecked")
      public <T> T create(Class<T> clazz, Class<?>[] constructorParamTypes, Object[] constructorArguments) {
          final ProxyFactory factory = new ProxyFactory();
          factory.setSuperclass(clazz);
  
          try {
              final Proxy proxy = (Proxy) (constructorParamTypes.length == 0 ?
                      factory.createClass().newInstance() :
                      factory.create(constructorParamTypes, constructorArguments));
              proxy.setHandler((self, overridden, proceed, args) -> {
                  final UnitOfWork unitOfWork = overridden.getAnnotation(UnitOfWork.class);
                  final UnitOfWorkAspect unitOfWorkAspect = new UnitOfWorkAspect(entityManagerFactories);
                  try {
                      unitOfWorkAspect.beforeStart(unitOfWork);
                      Object result = proceed.invoke(self, args);
                      unitOfWorkAspect.afterEnd();
                      return result;
                  } catch (InvocationTargetException e) {
                      unitOfWorkAspect.onError();
                      throw e.getCause();
                  } catch (Exception e) {
                      unitOfWorkAspect.onError();
                      throw e;
                  }
              });
              return (T) proxy;
          } catch (NoSuchMethodException | InstantiationException | IllegalAccessException |
                  InvocationTargetException e) {
              throw new IllegalStateException("Unable to create a proxy for the class '" + clazz + "'", e);
          }
      }
docs: Creates a new <b>@UnitOfWork</b> aware proxy of a class with a complex constructor.
  
  @param clazz                 the specified class definition
  @param constructorParamTypes the types of the constructor parameters
  @param constructorArguments  the arguments passed to the constructor
  @param <T>                   the type of the class
  @return a new proxy