### Question:
DefinitionResolver { public Optional<ElementParameters> resolveSimulationParameters(String id) { return Optional.ofNullable(simulationParameters.get(id)); } DefinitionResolver(
            Definitions definitions,
            Collection<WorkItemDefinition> workItemDefinitions,
            boolean jbpm,
            Mode mode);  DefinitionResolver(Definitions definitions,
                              Collection<WorkItemDefinition> workItemDefinitions); BPMNDiagram getDiagram(); double getResolutionFactor(); boolean isJbpm(); Definitions getDefinitions(); Process getProcess(); Mode getMode(); Collection<WorkItemDefinition> getWorkItemDefinitions(); Optional<Signal> resolveSignal(String id); String resolveSignalName(String id); Optional<ElementParameters> resolveSimulationParameters(String id); BPMNShape getShape(String elementId); BPMNEdge getEdge(String elementId);  }### Answer:
@Test public void testSimulation() { String elementRef = "some_element_ref"; EList<Scenario> scenarios = mock(EList.class); Scenario scenario = mock(Scenario.class); when(scenarios.get(0)).thenReturn(scenario); EList<ElementParameters> parameters = mock(EList.class); ElementParameters parameter = mock(ElementParameters.class); when(parameter.getElementRef()).thenReturn(elementRef); Iterator<ElementParameters> iterator = mock(Iterator.class); when(parameters.iterator()).thenReturn(iterator); when(iterator.hasNext()).thenReturn(Boolean.TRUE, Boolean.FALSE); when(iterator.next()).thenReturn(parameter); when(scenario.getElementParameters()).thenReturn(parameters); BPSimDataType simDataType = mock(BPSimDataType.class); simData.add(simDataType); when(simDataType.getScenario()).thenReturn(scenarios); setUp(); assertEquals(parameter, definitionResolver.resolveSimulationParameters(elementRef).get()); }
@Test public void testSimulation() { String elementRef = "some_element_ref"; EList<Scenario> scenarios = ECollections.newBasicEList(); Scenario scenario = mock(Scenario.class); scenarios.add(scenario); EList<ElementParameters> parameters = ECollections.newBasicEList(); ElementParameters parameter = mock(ElementParameters.class); when(parameter.getElementRef()).thenReturn(elementRef); parameters.add(parameter); when(scenario.getElementParameters()).thenReturn(parameters); BPSimDataType simDataType = mock(BPSimDataType.class); simData.add(simDataType); when(simDataType.getScenario()).thenReturn(scenarios); setUp(); assertEquals(parameter, definitionResolver.resolveSimulationParameters(elementRef).get()); }