### Question:
ProcessPropertyWriter extends BasePropertyWriter implements ElementContainer { public void addChildElement(BasePropertyWriter p) { Processes.addChildElement( p, childElements, process, simulationParameters, itemDefinitions, rootElements); addChildShape(p.getShape()); addChildEdge(p.getEdge()); if (p instanceof SubProcessPropertyWriter) { addSubProcess((SubProcessPropertyWriter) p); } else if (p instanceof DataObjectPropertyWriter) { DataObject dataObject = ((DataObjectPropertyWriter) p).getElement().getDataObjectRef(); maybeAddDataObjectToItemDefinitions(itemDefinitions, dataObject); } maybeAddDataObjectToItemDefinitions(itemDefinitions, dataObjects); } ProcessPropertyWriter(Process process, VariableScope variableScope, Set<DataObject> dataObjects); void setId(String value); Process getProcess(); void addChildShape(BPMNShape shape); void addChildEdge(BPMNEdge edge); BPMNDiagram getBpmnDiagram(); void addChildElement(BasePropertyWriter p); @Override Collection<BasePropertyWriter> getChildElements(); BasePropertyWriter getChildElement(String id); void setName(String value); void setExecutable(Boolean value); void setPackage(String value); void setType(String value); void setVersion(String value); void setAdHoc(Boolean adHoc); void setDescription(String value); void setProcessVariables(BaseProcessVariables processVariables); void setMetadata(final MetaDataAttributes metaDataAttributes); void setCaseFileVariables(CaseFileVariables caseFileVariables); void setCaseIdPrefix(CaseIdPrefix caseIdPrefix); void setCaseRoles(CaseRoles roles); void setGlobalVariables(GlobalVariables globalVariables); void setDefaultImports(List<DefaultImport> imports); void setSlaDueDate(SLADueDate slaDueDate); void addLaneSet(Collection<LanePropertyWriter> lanes); Collection<ElementParameters> getSimulationParameters(); Relationship getRelationship(); Set<DataObject> getDataObjects();  }### Answer:
@Test public void addChildElement() { Process process = p.getProcess(); BoundaryEventPropertyWriter boundaryEventPropertyWriter = new BoundaryEventPropertyWriter(bpmn2.createBoundaryEvent(), variableScope, new HashSet<>()); UserTaskPropertyWriter userTaskPropertyWriter = new UserTaskPropertyWriter(bpmn2.createUserTask(), variableScope, new HashSet<>()); SubProcessPropertyWriter subProcessPropertyWriter = new SubProcessPropertyWriter(bpmn2.createSubProcess(), variableScope, new HashSet<>()); final DataObjectReference dataObjectReference = bpmn2.createDataObjectReference(); DataObjectPropertyWriter dataObjectPropertyWriter = new DataObjectPropertyWriter(dataObjectReference, variableScope, new HashSet<>()); final DataObject dataObject = dataObjectPropertyWriter.getElement().getDataObjectRef(); dataObject.getItemSubjectRef(); ItemDefinition itemDefinition = mock(ItemDefinition.class); when(itemDefinition.getId()).thenReturn("someId"); dataObject.setItemSubjectRef(itemDefinition); dataObject.getItemSubjectRef(); subProcessPropertyWriter.addChildElement(dataObjectPropertyWriter); p.addChildElement(subProcessPropertyWriter); p.addChildElement(boundaryEventPropertyWriter); p.addChildElement(userTaskPropertyWriter); assertThat(process.getFlowElements().get(0)).isEqualTo(userTaskPropertyWriter.getFlowElement()); assertThat(process.getFlowElements().get(1)).isEqualTo(subProcessPropertyWriter.getFlowElement()); assertThat(process.getFlowElements().get(2)).isEqualTo(boundaryEventPropertyWriter.getFlowElement()); }