public void testTwoGlobalTasksUnmarshalling() throws Exception {
Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
Definitions definitions = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("twoTask.json"), "").getContents().get(0));
assertTrue(definitions.getRootElements().size() == 2);
assertTrue(definitions.getRootElements().get(0) instanceof GlobalTask);
GlobalTask task = (GlobalTask) definitions.getRootElements().get(0);
assertEquals("firstTask", task.getName());
assertEquals("my task doc", task.getDocumentation().iterator().next().getText());
GlobalTask task2 = (GlobalTask) definitions.getRootElements().get(1);
assertEquals("secondTask", task2.getName());
assertEquals("my task doc too", task2.getDocumentation().iterator().next().getText());
definitions.eResource().save(System.out, Collections.emptyMap());
}