assertNotNull(subProcessInstance);
ProcessInstance failingSubProcessInstance = runtimeService.createProcessInstanceQuery().superProcessInstanceId(subProcessInstance.getId()).singleResult();
assertNotNull(subProcessInstance);
Incident incident = runtimeService.createIncidentQuery().processInstanceId(failingSubProcessInstance.getId()).singleResult();
assertNotNull(incident);
IncidentQuery query = runtimeService.createIncidentQuery().rootCauseIncidentId(incident.getId());
assertEquals(3, query.count());
List<Incident> incidents = query.list();
assertFalse(incidents.isEmpty());
assertEquals(3, incidents.size());