### Question:
DataTypeListItem { void refresh() { dataTypeSelectComponent.refresh(); dataTypeSelectComponent.init(this, getDataType()); dataTypeConstraintComponent.refreshView(); view.setName(getDataType().getName()); setupListComponent(); setupConstraintComponent(); hideTooltips(); } @Inject  DataTypeListItem(final View view,
                            final DataTypeSelect dataTypeSelectComponent,
                            final DataTypeConstraint dataTypeConstraintComponent,
                            final SmallSwitchComponent dataTypeListComponent,
                            final DataTypeManager dataTypeManager,
                            final DataTypeConfirmation confirmation,
                            final DataTypeNameFormatValidator nameFormatValidator,
                            final Event<DataTypeEditModeToggleEvent> editModeToggleEvent,
                            final Event<DataTypeChangedEvent> dataTypeChangedEvent); void init(final DataTypeList dataTypeList); DataType getDataType(); boolean isReadOnly(); int getLevel(); boolean isCollapsed(); void expand(); void collapse(); void enableEditMode(); void disableEditMode(); void saveAndCloseEditMode(); void remove(); Command removeItem(); Command destroy(); void destroyWithDependentTypes(); void destroyWithoutDependentTypes(); String getType(); void insertFieldAbove(); String insertFieldAbove(final DataType dataType); void insertFieldBelow(); String insertFieldBelow(final DataType dataType); void insertNestedField(); void insertNestedField(final DataType newDataType); HTMLElement getDragAndDropElement(); void highlightLevel(final DataType dataType);  }### Answer:
@Test public void testRefresh() { final DataType dataType = spy(makeDataType()); final String expectedConstraint = "constraint"; final String expectedName = "name"; doReturn(expectedConstraint).when(dataType).getConstraint(); doReturn(expectedName).when(dataType).getName(); doReturn(dataType).when(listItem).getDataType(); doNothing().when(listItem).hideTooltips(); listItem.refresh(); verify(dataTypeSelectComponent).refresh(); verify(dataTypeSelectComponent).init(listItem, dataType); verify(dataTypeConstraintComponent).refreshView(); verify(view).setName(expectedName); verify(listItem).setupListComponent(); verify(listItem).setupConstraintComponent(); verify(listItem).hideTooltips(); }