Source:
<code>public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(executionSet.getCalledElement().getValue()); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (executionSet instanceof ReusableSubprocessTaskExecutionSet && Boolean.TRUE.equals(((ReusableSubprocessTaskExecutionSet)executionSet).getIsMultipleInstance().getValue())) { <START> p.setCollectionInput(((ReusableSubprocessTaskExecutionSet)executionSet).getMultipleInstanceCollectionInput().getValue()); <END> p.setInput(((ReusableSubprocessTaskExecutionSet)executionSet).getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(((ReusableSubprocessTaskExecutionSet)executionSet).getMultipleInstanceCollectionOutput().getValue()); p.setOutput(((ReusableSubprocessTaskExecutionSet)executionSet).getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(((ReusableSubprocessTaskExecutionSet)executionSet).getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setBounds(n.getContent().getBounds()); return p; }</code><technical_language>for a readability, creating a new typed variable avoid cast ReusableSubprocessTaskExecutionSet line</technical_language>

Target:
public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(executionSet.getCalledElement().getValue()); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (executionSet instanceof ReusableSubprocessTaskExecutionSet) { ReusableSubprocessTaskExecutionSet reusableExecutionSet = (ReusableSubprocessTaskExecutionSet) executionSet; if (Boolean.TRUE.equals(reusableExecutionSet.getIsMultipleInstance().getValue())) { p.setCollectionInput(reusableExecutionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(reusableExecutionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(reusableExecutionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(reusableExecutionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(reusableExecutionSet.getMultipleInstanceCompletionCondition().getValue()); } } p.setSimulationSet(definition.getSimulationSet()); p.setBounds(n.getContent().getBounds()); return p; }