public void testNestedForkJoin() {
String pid = runtimeService.startProcessInstanceByKey("nestedForkJoin").getId();
// After process startm, only task 0 should be active
TaskQuery query = taskService.createTaskQuery().orderByTaskName().asc();
List<Task> tasks = query.list();
assertEquals(1, tasks.size());
assertEquals("Task 0", tasks.get(0).getName());
assertEquals(1, runtimeService.getActivityInstance(pid).getChildActivityInstances().length);
// Completing task 0 will create Task A and B