Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
Definitions definitions = unmarshaller.unmarshall(getTestJsonFile("sequenceFlow.json"));
assertTrue(definitions.getRootElements().size() == 1);
Process process = (Process) definitions.getRootElements().get(0);
assertTrue(process.getFlowElements().get(0) instanceof Task);
Task task = (Task) process.getFlowElements().get(0);
assertEquals("task1", task.getName());
Task task2 = (Task) process.getFlowElements().get(1);
assertEquals("task2", task2.getName());
SequenceFlow flow = (SequenceFlow) process.getFlowElements().get(2);
assertEquals("seqFlow", flow.getName());
assertEquals(task, flow.getSourceRef());
assertEquals(task2, flow.getTargetRef());
definitions.eResource().save(System.out, Collections.emptyMap());