docs: public static <T> Class<T> toClass(CtClass ctClass, ClassLoader loader, ProtectionDomain domain) throws CannotCompileException {
          try {
              byte[] byteCode = ctClass.toBytecode();
  
              if (domain == null) {
                  return bruteForceDefineClass(DEFINE_METHOD_NO_DOMAIN, loader, ctClass.getName(), byteCode, 0, byteCode.length);
              } else {
                  return bruteForceDefineClass(DEFINE_METHOD_WITH_DOMAIN, loader, ctClass.getName(), byteCode, 0, byteCode.length, domain);
              }
          } catch (Exception e) {
              ExceptionUtil.propagateIfInstanceOf(e, CannotCompileException.class);
              ExceptionUtil.propagateIfPossible(e);
  
              throw new CannotCompileException(e);
          } finally {
              ctClass.prune();
          }
      }