### Question:
DocumentationLinksWidget extends Composite implements HasValue<DocumentationLinks>,
                                                                   HasEnabled { void refresh() { final List<DMNExternalLink> all = getValue().getLinks(); RemoveHelper.removeChildren(linksContainer); for (final DMNExternalLink link : all) { final DocumentationLinkItem listItem = listItems.get(); listItem.init(link); listItem.setOnDeleted(this::onExternalLinkDeleted); linksContainer.appendChild(listItem.getElement()); } refreshContainersVisibility(); } @Inject  DocumentationLinksWidget(final ManagedInstance<DocumentationLinkItem> listItems,
                                    final TranslationService translationService,
                                    final HTMLDivElement linksContainer,
                                    final HTMLDivElement noneContainer,
                                    final HTMLAnchorElement addButton,
                                    final NameAndUrlPopoverView.Presenter nameAndUrlPopover,
                                    final CellEditorControlsView cellEditor,
                                    @Named("span") final HTMLElement addLink,
                                    @Named("span") final HTMLElement noLink,
                                    final Event<LockRequiredEvent> locker,
                                    final @DMNEditor ReadOnlyProvider readOnlyProvider); @PostConstruct void init(); @Override DocumentationLinks getValue(); @Override void setValue(final DocumentationLinks documentationLinks); @Override void setValue(final DocumentationLinks documentationLinks,
                         final boolean fireEvents); @EventHandler("add-button") @SuppressWarnings("unused") void onClickTypeButton(final ClickEvent clickEvent); @Override HandlerRegistration addValueChangeHandler(final ValueChangeHandler<DocumentationLinks> handler); @Override boolean isEnabled(); @Override void setEnabled(final boolean enabled); void setDMNModel(final DRGElement model);  }### Answer:
@Test public void testRefresh() { final DocumentationLinks value = mock(DocumentationLinks.class); final DMNExternalLink externalLink = mock(DMNExternalLink.class); final List<DMNExternalLink> links = new ArrayList<>(); links.add(externalLink); final DocumentationLinkItem listItem = mock(DocumentationLinkItem.class); final HTMLElement element = mock(HTMLElement.class); when(listItem.getElement()).thenReturn(element); when(listItems.get()).thenReturn(listItem); widget.setValue(value); when(value.getLinks()).thenReturn(links); widget.refresh(); verify(listItem).init(externalLink); verify(linksContainer).appendChild(element); verify(widget).refreshContainersVisibility(); }