class Builder implements Serializable {

    public KieContainer getKieContainer() {
        BuildResults results = null;

        //Kie classes are only available once built
        if (!isBuilt()) {
            results = build();
        } else {
            results = new BuildResults();
            results.addAllBuildMessages(convertMessages(kieBuilder.getResults().getMessages(),
                                                        handles));
        }
        //It's impossible to retrieve a KieContainer if the KieModule contains errors
        if (results.getErrorMessages().isEmpty()) {
            // Do not retrieve the KieContainer with KieServices.newKieContainer(releaseId) since this looks-up the KieModule to
            // create the KieContainer from KieRepository. This holds the most recent KieModule (for the ReleaseId) that was built with
            // kieBuilder.buildAll() which *may* be a KieModule created during asset validation and hence will lack many assets.
            // See https://bugzilla.redhat.com/show_bug.cgi?id=1202551
            final org.kie.api.builder.KieModule kieModule = kieBuilder.getKieModule();
            final ReleaseId releaseId = kieModule.getReleaseId();
            final org.drools.compiler.kie.builder.impl.KieProject kieProject = new KieModuleKieProject((InternalKieModule) kieBuilder.getKieModule(),
                                                                                                       null);
            final KieContainer kieContainer = new KieContainerImpl(kieProject,
                                                                   KieServices.Factory.get().getRepository(),
                                                                   releaseId);
            return kieContainer;
        } else {
            return null;
        }
    }

    public  Builder(final Module project,
                   final IOService ioService,
                   final KieModuleService moduleService,
                   final ProjectImportsService importsService,
                   final List<BuildValidationHelper> buildValidationHelpers,
                   final LRUModuleDependenciesClassLoaderCache dependenciesClassLoaderCache,
                   final LRUPomModelCache pomModelCache,
                   final PackageNameWhiteListService packageNameWhiteListService,
                   final Predicate<String> classFilter,
                   final KieBuilder kieBuilder,
                   final KieFileSystem kieFileSystem);
    public  Builder(final Module project,
                   final IOService ioService,
                   final KieModuleService moduleService,
                   final ProjectImportsService importsService,
                   final List<BuildValidationHelper> buildValidationHelpers,
                   final LRUModuleDependenciesClassLoaderCache dependenciesClassLoaderCache,
                   final LRUPomModelCache pomModelCache,
                   final PackageNameWhiteListService packageNameWhiteListService,
                   final Predicate<String> classFilter);

}