### Question:
DataTypeList { void refreshItemsByUpdatedDataTypes(final List<DataType> updateDataTypes) { for (final DataType dataType : updateDataTypes) { findItem(dataType).ifPresent(listItem -> { listItem.refresh(); refreshSubItemsFromListItem(listItem, dataType.getSubDataTypes()); }); } refreshDragAndDropList(); refreshSearchBar(); } @Inject  DataTypeList(final View view,
                        final ManagedInstance<DataTypeListItem> listItems,
                        final DataTypeManager dataTypeManager,
                        final DataTypeSearchBar searchBar,
                        final DNDListComponent dndListComponent,
                        final DataTypeStackHash dataTypeStackHash,
                        final DNDDataTypesHandler dndDataTypesHandler,
                        final DataTypeListHighlightHelper highlightHelper,
                        final IsKogito isKogito); HTMLElement getElement(); void setupItems(final List<DataType> dataTypes); Optional<DataTypeListItem> findItem(final DataType dataType); DNDListComponent getDNDListComponent(); List<DataTypeListItem> getItems(); void showNoDataTypesFound(); void showListItems(); void collapseAll(); void enableEditMode(final String dataTypeHash); void registerDataTypeListItemUpdateCallback(final Consumer<DataTypeListItem> onDataTypeListItemUpdate); Optional<DataTypeListItem> findItemByDataTypeHash(final String dataTypeHash); String calculateHash(final DataType dataType); void onDataTypeEditModeToggle(final @Observes DataTypeEditModeToggleEvent event); HTMLElement getListItems(); void importDataObjects(final List<DataObject> selectedDataObjects); void disableEditModeForChildren(final DataTypeListItem dataTypeListItem); List<String> getExistingDataTypesNames(); void highlightLevel(final DataType dataType); void highlightLevel(final Element element); void highlight(final Element element); void cleanLevelHighlightClass(); void cleanHighlightClass();  }### Answer:
@Test public void testRefreshItemsByUpdatedDataTypes() { final String uuid1 = "uuid1"; final String uuid2 = "uuid2"; final String uuid3 = "uuid3"; final DataType dataType1 = mock(DataType.class); final DataType dataType2 = mock(DataType.class); final DataType dataType3 = mock(DataType.class); final DataTypeListItem listItem = mock(DataTypeListItem.class); final List<DataType> subDataTypes = asList(dataType2, dataType3); final List<DataType> existingItems = new ArrayList<>(asList(dataType1, dataType2, dataType3)); doReturn(Optional.of(listItem)).when(dataTypeList).findItem(dataType1); doReturn(Optional.empty()).when(dataTypeList).findItem(dataType2); doReturn(Optional.empty()).when(dataTypeList).findItem(dataType3); doNothing().when(dataTypeList).refreshSubItemsFromListItem(any(), anyListOf(DataType.class)); when(dataType1.getUUID()).thenReturn(uuid1); when(dataType2.getUUID()).thenReturn(uuid2); when(dataType3.getUUID()).thenReturn(uuid3); when(dataType1.getSubDataTypes()).thenReturn(subDataTypes); dataTypeList.refreshItemsByUpdatedDataTypes(existingItems); verify(listItem).refresh(); verify(dataTypeList).refreshSubItemsFromListItem(listItem, subDataTypes); verify(dndListComponent).consolidateYPosition(); verify(dndListComponent).refreshItemsPosition(); verify(searchBar).refresh(); }