public URLClassLoader compileGeneratedSources()
    {
        final JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
        final StandardJavaFileManager standardFileManager = compiler.getStandardFileManager(null, null, null);
        final InMemoryFileManager fileManager = new InMemoryFileManager(standardFileManager);
        final JavaCompiler.CompilationTask task = compiler.getTask(
            null,
            fileManager,
            null,
            null,
            null,
            sourceFiles.values());

        if (!task.call())
        {
            throw new IllegalStateException("Compilation failed");
        }

        final GeneratedCodeLoader classLoader = new GeneratedCodeLoader(getClass().getClassLoader());
        classLoader.defineClasses(fileManager);
        return classLoader;
    }
Compile the generated sources and return a {@link URLClassLoader} that can be used to load the generated classes.

@return a {@link URLClassLoader} that can be used to load the generated classes
sbe-tool/src/propertyTest/java/uk/co/real_logic/sbe/properties/utils/InMemoryOutputManager.java