AbstractDMODataManagementStrategy extends AbstractDataManagementStrategy { protected Callback<String> superTypeAggregatorCallBack(final List<String> dataObjectsTypes, final Map<String, String> superTypeMap, final TestToolsView.Presenter testToolsPresenter, final int expectedElements, final SortedMap<String, FactModelTree> dataObjectsFieldsMap, final ScenarioSimulationContext context, final List<String> simpleJavaTypes, final GridWidget gridWidget, final String factType) { return superType -> { superTypeMap.put(factType, superType); if (superTypeMap.size() == expectedElements) { manageDataObjects(dataObjectsTypes, superTypeMap, testToolsPresenter, expectedElements, dataObjectsFieldsMap, context, simpleJavaTypes, gridWidget); } }; }  @Override void populateTestTools(final TestToolsView.Presenter testToolsPresenter,
                                  final ScenarioSimulationContext context,
                                  final GridWidget gridWidget); FactModelTree getFactModelTree(String factName, Map<String, String> superTypeMap, ModelField[] modelFields); void populateGenericTypeMap(Map<String, List<String>> toPopulate, String factName, String propertyName, boolean isList); void aggregatorCallbackMethod(final TestToolsView.Presenter testToolsPresenter,
                                         final int expectedElements,
                                         final SortedMap<String, FactModelTree> factTypeFieldsMap,
                                         final ScenarioSimulationContext context,
                                         final FactModelTree result,
                                         final List<String> simpleJavaTypes,
                                         final GridWidget gridWidget); void populateFactModelTree(FactModelTree toPopulate, final SortedMap<String, FactModelTree> factTypeFieldsMap);  }
@Test public void superTypeAggregatorCallBack() { String factType = "factType"; String factType2 = "factType2"; int expectedElement = 2; List<String> dataObjectsType = Arrays.asList(factType, factType2); SortedMap<String, FactModelTree> dataObjectsFieldMap = new TreeMap<>(); Map<String, String> superTypesMap = new HashMap<>(); List<String> javaSimpleType = new ArrayList<>(); Callback<String> callback = abstractDMODataManagementStrategySpy.superTypeAggregatorCallBack(dataObjectsType, superTypesMap, testToolsPresenterMock, expectedElement, dataObjectsFieldMap, scenarioSimulationContextLocal, javaSimpleType, GridWidget.SIMULATION, factType); callback.callback(Object.class.getCanonicalName()); assertTrue(superTypesMap.containsKey(factType)); assertEquals(Object.class.getCanonicalName(), superTypesMap.get(factType)); Callback<String> callback2 = abstractDMODataManagementStrategySpy.superTypeAggregatorCallBack(dataObjectsType, superTypesMap, testToolsPresenterMock, expectedElement, dataObjectsFieldMap, scenarioSimulationContextLocal, javaSimpleType, GridWidget.SIMULATION, factType2); callback2.callback(Class.class.getCanonicalName()); assertTrue(superTypesMap.containsKey(factType2)); assertEquals(Class.class.getCanonicalName(), superTypesMap.get(factType2)); verify(abstractDMODataManagementStrategySpy, times(1)).manageDataObjects(eq(dataObjectsType), eq(superTypesMap), eq(testToolsPresenterMock), eq(expectedElement), eq(dataObjectsFieldMap), eq(scenarioSimulationContextLocal), eq(javaSimpleType), eq(GridWidget.SIMULATION)); }