@Test
public void testCreationOfDuplicatedManagers() {

    RuntimeEnvironment environment = RuntimeEnvironmentBuilder.Factory.get()
			.newDefaultBuilder()
            .userGroupCallback(userGroupCallback)
            .addAsset(ResourceFactory.newClassPathResource("BPMN2-ScriptTask.bpmn2"), ResourceType.BPMN2)
            .get();
    
    manager = RuntimeManagerFactory.Factory.get().newSingletonRuntimeManager(environment);        
    assertNotNull(manager);
    try {
        RuntimeManagerFactory.Factory.get().newSingletonRuntimeManager(environment);
        fail("Should fail as it's not allowed to have singleton manager with same identifier");
    } catch (IllegalStateException e) {
        
    }
    manager.close();
    
    // now it is possible to load the manager again
    manager = RuntimeManagerFactory.Factory.get().newSingletonRuntimeManager(environment);        
    assertNotNull(manager);
}