creates a ClassCollector for a new compilation.

@param unit the compilationUnit
@param su   the SourceUnit
@return the ClassCollector
483478
protected ClassCollector createCollector(CompilationUnit unit, SourceUnit su) {
        InnerLoader loader = AccessController.doPrivileged(new PrivilegedAction<InnerLoader>() {
            public InnerLoader run() {
                return new InnerLoader(GroovyClassLoader.this);
            }
        });
        return new ClassCollector(loader, unit, su);
    }
1332402
public SourceUnit addSource(File file) {
        return addSource(new SourceUnit(file, configuration, classLoader, getErrorCollector()));
    }
619983
@NonNull
    public <T> List<T> create(@NonNull Collection<Class<? extends T>> classes) {
        final List<T> result = new ArrayList<>();
        for (Class<? extends T> clazz : classes) {
            final T instance = create(clazz);
            if (instance != null) {
                result.add(instance);
            }
        }
        return result;
    }
1166969
public GeneratedClassLoader createClassLoader(ClassLoader parent)
    {
        ContextFactory f = getFactory();
        return f.createClassLoader(parent);
    }
435569
public Class createClass(String className) throws ClassNotFoundException {
        Class clazz;
        try {
            clazz = Class.forName(className);
            return clazz;

        } catch (ExceptionInInitializerError eiie) {
            String info = "Could not load the " + description + " object: " + className
                    + ". Could not initialize static object in server: ";
            info += eiie.getMessage();
            throw new ClassNotFoundException(info, eiie);

        } catch (LinkageError le) {
            String info = "Could not load the " + description + " object: " + className
                    + ". This object is depending on a class that has been changed after compilation ";
            info += "or a class that was not found: ";
            info += le.getMessage();
            throw new ClassNotFoundException(info, le);

        } catch (ClassNotFoundException cnfe) {
            String info = "Could not find the " + description + " object: " + className + ": ";
            info += cnfe.getMessage();
            throw new ClassNotFoundException(info, cnfe);
        }
    }
101415
public static JavaCompilerUtil create(ClassLoader loader)
  {
    JavacConfig config = JavacConfig.getLocalConfig();

    String javac = config.getCompiler();

    JavaCompilerUtil javaCompiler = new JavaCompilerUtil();

    if (loader == null) {
      loader = Thread.currentThread().getContextClassLoader();
    }

    javaCompiler.setClassLoader(loader);
    javaCompiler.setCompiler(javac);
    javaCompiler.setArgs(config.getArgs());
    javaCompiler.setEncoding(config.getEncoding());
    javaCompiler.setMaxBatch(config.getMaxBatch());
    javaCompiler.setStartTimeout(config.getStartTimeout());
    javaCompiler.setMaxCompileTime(config.getMaxCompileTime());

    return javaCompiler;
  }
992173
protected final void addDataCollector(final Class collectorName) {
		if (!DataCollector.class.isAssignableFrom(collectorName)) {
			throw new RuntimeException("Class must be subclass of DataCollector!");
		}
		collectors.add(collectorName);
	}
129826
public ClassLoader buildClassLoader(ClassLoader serviceLoader)
  {
    synchronized (_loaderMap) {
      SoftReference<ClassLoader> extLoaderRef = _loaderMap.get(serviceLoader);
      
      if (extLoaderRef != null) {
        ClassLoader extLoader = extLoaderRef.get();
        
        if (extLoader != null) {
          return extLoader;
        }
      }
    }
    
    String parentId = EnvLoader.getEnvironmentName(serviceLoader);
    
    String id = _id + "!" + parentId;
    
    //DynamicClassLoader extLoader = new PodExtClassLoader(serviceLoader, id);
    DynamicClassLoader extLoader = null;

    /*
    LibraryLoader libLoader
      = new LibraryLoader(extLoader, getRootDirectory().lookup("lib"));
    libLoader.init();
    
    CompilingLoader compLoader
      = new CompilingLoader(extLoader, getRootDirectory().lookup("classes"));
    compLoader.init();
    
    synchronized (_loaderMap) {
      SoftReference<ClassLoader> extLoaderRef = _loaderMap.get(serviceLoader);
      
      if (extLoaderRef != null) {
        ClassLoader extLoaderOld = extLoaderRef.get();
        
        if (extLoaderOld != null) {
          return extLoaderOld;
        }
      }
      
      _loaderMap.put(serviceLoader, new SoftReference<>(extLoader));
    }
    */
    
    return extLoader;
  }
17945
public static Object createDynamicInstance(Class<?> cls) throws IOException
    {
        GenClassCompiler pc = GenClassCompiler.compile(El.getTypeElement(cls.getCanonicalName()), null);
        return pc.loadDynamic();
    }
518255
public static <T> Class<T> compile(ClassLoader cl, String name, String code) {
		Tuple2<ClassLoader, String> cacheKey = Tuple2.of(cl, name);
		Class<?> clazz = COMPILED_CACHE.getIfPresent(cacheKey);
		if (clazz == null) {
			clazz = doCompile(cl, name, code);
			COMPILED_CACHE.put(cacheKey, clazz);
		}
		//noinspection unchecked
		return (Class<T>) clazz;
	}
1321870
public GroovyClassLoader createGroovyClassLoader(final ClassLoader classLoader, final ResourceLoader resourceLoader) {
    return AccessController.doPrivileged(new PrivilegedAction<GroovyClassLoader>()
    {
      @Override
      public GroovyClassLoader run() {
        GroovyClassLoader gcl = new GroovyClassLoader(classLoader);
        gcl.setResourceLoader(createGroovyResourceLoader(resourceLoader));
        return gcl;
      }
    });
  }
369289
public static JUnitSecurityReportCollector newReportCollector() {
        String className = System.getProperty("soapui.junit.reportCollector", null);
        if (StringUtils.isNotBlank(className)) {
            try {
                return (JUnitSecurityReportCollector) Class.forName(className).getConstructor().newInstance();
            } catch (Exception e) {
                log.warn("Failed to create JUnitReportCollector class [" + className + "] so use the default one;"
                        + " error cause: " + e.toString());
            }
        }
        return new JUnitSecurityReportCollector();
    }
969061
@Override
    public <T> Future<T> unit(final T unit) {
        return new Future<T>(
                              CompletableFuture.completedFuture(unit));
    }
1076476
public CompilationUnit createCompilationUnit(String name) {

        if (name != null && name.equals(getTemplateName())) {
            return new TextCompilationUnit(name, this, getText());
        }
        
        // Create a compilation unit for a .tea file
        return super.createCompilationUnit(name);
    }
49304
public static UnitRequest create(Class<? extends Unit> unitClass) {
        Unit unit = LocalUnitsManager.getUnitByUnitClass(unitClass);
        return create(unit.getGroup().getName(), unit.getName());
    }
1086888
@Override
	public JvmDeclaredType createType(BinaryClass binaryClass) {
		if (useASM) {
			try {
				createTypeTask.start();
				return doCreateType(binaryClass);
			} catch (Exception e) {
				throw new RuntimeException(e);
			} finally {
				createTypeTask.stop();
			}
		} else {
			try {
				ReflectURIHelper uriHelper = new ReflectURIHelper();
				ReflectionTypeFactory reflectionBased = new ReflectionTypeFactory(uriHelper);
				Class<?> clazz = Class.forName(binaryClass.getName(), false, classLoader);
				return reflectionBased.createType(clazz);
			} catch (ClassNotFoundException e) {
				throw new RuntimeException(e);
			}
		}
	}
281197
public static <E extends Enum<E>> EnumJsonDeserializer<E> newInstance( Class<E> enumClass ) {
        return new EnumJsonDeserializer<E>( enumClass );
    }