docs: protected RuntimeEnvironmentBuilder boostrapRuntimeEnvironmentBuilder(KModuleDeploymentUnit deploymentUnit,
      		DeployedUnit deployedUnit, KieContainer kieContainer, MergeMode mode) {
      	DeploymentDescriptor descriptor = deploymentUnit.getDeploymentDescriptor();
      	if (descriptor == null || ((DeploymentDescriptorImpl)descriptor).isEmpty()) { // skip empty descriptors as its default can override settings
  	    	DeploymentDescriptorManager descriptorManager = new DeploymentDescriptorManager("org.jbpm.domain");
              List<DeploymentDescriptor> descriptorHierarchy = DeploymentDescriptorManagerUtil.getDeploymentDescriptorHierarchy(descriptorManager, kieContainer);
  
  			descriptor = merger.merge(descriptorHierarchy, mode);
  			deploymentUnit.setDeploymentDescriptor(descriptor);
      	} else if (descriptor != null && !deploymentUnit.isDeployed()) {
      		DeploymentDescriptorManager descriptorManager = new DeploymentDescriptorManager("org.jbpm.domain");
              List<DeploymentDescriptor> descriptorHierarchy = DeploymentDescriptorManagerUtil.getDeploymentDescriptorHierarchy(descriptorManager, kieContainer);
  
  	    	descriptorHierarchy.add(0, descriptor);
  	    	descriptor = merger.merge(descriptorHierarchy, mode);
  			deploymentUnit.setDeploymentDescriptor(descriptor);
      	}
  
  		// first set on unit the strategy
  		deploymentUnit.setStrategy(descriptor.getRuntimeStrategy());
  
  		// setting up runtime environment via builder
  		RuntimeEnvironmentBuilder builder = null;
  		if (descriptor.getPersistenceMode() == PersistenceMode.NONE) {
  			builder = RuntimeEnvironmentBuilder.Factory.get().newDefaultInMemoryBuilder();
  		} else {
  			builder = RuntimeEnvironmentBuilder.Factory.get().newDefaultBuilder();
  		}
  		// populate various properties of the builder
  		EntityManagerFactory emf = EntityManagerFactoryManager.get().getOrCreate(descriptor.getPersistenceUnit());
  		builder.entityManagerFactory(emf);
  
  		Map<String, Object> contaxtParams = new HashMap<String, Object>();
  		contaxtParams.put("entityManagerFactory", emf);
  		contaxtParams.put("classLoader", kieContainer.getClassLoader());
  		// process object models that are globally configured (environment entries, session configuration)
  		for (NamedObjectModel model : descriptor.getEnvironmentEntries()) {
  			Object entry = getInstanceFromModel(model, kieContainer, contaxtParams);
  			builder.addEnvironmentEntry(model.getName(), entry);
  		}
  
  		for (NamedObjectModel model : descriptor.getConfiguration()) {
  			Object entry = getInstanceFromModel(model, kieContainer, contaxtParams);
  			builder.addConfiguration(model.getName(), (String) entry);
  		}
  		List<ObjectMarshallingStrategy> mStrategies = new ArrayList<>();
  		for (ObjectModel model : descriptor.getMarshallingStrategies()) {
  			Object strategy = getInstanceFromModel(model, kieContainer, contaxtParams);
  			mStrategies.add((ObjectMarshallingStrategy)strategy);
  		}
  		// lastly add the main default strategy
  		mStrategies.add(new SerializablePlaceholderResolverStrategy(ClassObjectMarshallingStrategyAcceptor.DEFAULT));
  		mStrategies.add(new JavaSerializableResolverStrategy(ClassObjectMarshallingStrategyAcceptor.DEFAULT));
  		builder.addEnvironmentEntry(EnvironmentName.OBJECT_MARSHALLING_STRATEGIES, mStrategies.toArray(new ObjectMarshallingStrategy[0]));
  
  		builder.addEnvironmentEntry("KieDeploymentDescriptor", descriptor);
  		builder.addEnvironmentEntry("KieContainer", kieContainer);
  		if (executorService != null) {
  		    builder.addEnvironmentEntry("ExecutorService", executorService);
  		}
  		if (identityProvider != null) {
              builder.addEnvironmentEntry(EnvironmentName.IDENTITY_PROVIDER, identityProvider);
          }
  		// populate all assets with roles for this deployment unit
  		List<String> requiredRoles = descriptor.getRequiredRoles(DeploymentDescriptor.TYPE_VIEW);
  		if (requiredRoles != null && !requiredRoles.isEmpty()) {
  			for (DeployedAsset desc : deployedUnit.getDeployedAssets()) {
  				if (desc instanceof ProcessAssetDesc) {
  					((ProcessAssetDesc) desc).setRoles(requiredRoles);
  				}
  			}
  		}
  
  		// Classes 3: classes added from descriptor
  		List<String> remoteableClasses = descriptor.getClasses();
  		if (remoteableClasses != null && !remoteableClasses.isEmpty()) {
  			for (String className : remoteableClasses) {
  			    Class descriptorClass = null;
  				try {
  				    descriptorClass = kieContainer.getClassLoader().loadClass(className);
                      logger.debug( "Loaded {} into the classpath from deployment descriptor {}", className, kieContainer.getReleaseId().toExternalForm());
                  } catch (ClassNotFoundException cnfe) {
                      throw new IllegalArgumentException("Class " + className + " not found in the project");
                  } catch (NoClassDefFoundError e) {
                  	throw new IllegalArgumentException("Class " + className + " not found in the project");
  				}
  				addClassToDeployedUnit(descriptorClass, (DeployedUnitImpl) deployedUnit);
  			}
  		}
  
      	return builder;
      }