### Question:
TreeList { public void refresh() { clear(); for (final TreeListItem item : getCurrentItems()) { item.updateView(); view.add(item); item.setOnIsSelectedChanged(this::selectionChanged); } } @Inject  TreeList(final View view); void populate(final List<TreeListItem> items); void refresh(); List<TreeListItem> getCurrentItems(); void clear(); Node getElement(); void clearSelection(); List<TreeListItem> getSelectedItems(); void setOnSelectionChanged(final Consumer<List<TreeListItem>> onSelectionChanged);  }### Answer:
@Test public void testRefresh() { treeList.refresh(); verify(treeList).clear(); verify(itemOne).updateView(); verify(itemTwo).updateView(); verify(itemThree).updateView(); verify(view).add(itemOne); verify(view).add(itemTwo); verify(view).add(itemThree); }