### Question:
DataTypeSelect { void refreshView(final String typeName) { subDataTypes = dataTypeManager.from(getDataType()).makeExternalDataTypes(typeName); listItem.refreshSubItems(subDataTypes, false); listItem.refreshConstraintComponent(); listItem.expand(); subDataTypes.forEach(listItem::highlightLevel); } @Inject  DataTypeSelect(final View view,
                          final DataTypeUtils dataTypeUtils,
                          final DataTypeManager dataTypeManager); HTMLElement getElement(); void init(final DataTypeListItem gridItem,
                     final DataType dataType); String getValue();  }### Answer:
@Test public void testRefreshView() { final String typeName = "typeName"; final DataType parent = mock(DataType.class); final DataType subDataType = mock(DataType.class); final List<DataType> expectedDataTypes = singletonList(subDataType); doReturn(parent).when(dataTypeSelect).getDataType(); when(dataTypeManager.from(parent)).thenReturn(dataTypeManager); when(dataTypeManager.makeExternalDataTypes(typeName)).thenReturn(expectedDataTypes); dataTypeSelect.init(listItem, parent); dataTypeSelect.refreshView(typeName); assertEquals(expectedDataTypes, dataTypeSelect.getSubDataTypes()); verify(listItem).refreshSubItems(expectedDataTypes, false); verify(listItem).refreshConstraintComponent(); verify(listItem).expand(); verify(listItem).highlightLevel(subDataType); }