### Question:
DecisionNavigatorTreePresenter { void index(final Collection<DecisionNavigatorItem> items) { items.forEach(this::index); } @Inject  DecisionNavigatorTreePresenter(final View view); View getView(); void setupItems(final List<DecisionNavigatorItem> items); void removeAllItems(); DecisionNavigatorItem getActiveParent(); void setActiveParentUUID(final String activeParentUUID); void selectItem(final String uuid); void deselectItem();  }### Answer:
@Test public void testListIndex() { final DecisionNavigatorItem item1 = mock(DecisionNavigatorItem.class); final DecisionNavigatorItem item2 = mock(DecisionNavigatorItem.class); final List<DecisionNavigatorItem> items = Arrays.asList(item1, item2); presenter.index(items); verify(presenter).index(item1); verify(presenter).index(item2); }
@Test public void testItemIndex() { final DecisionNavigatorItem item = mock(DecisionNavigatorItem.class); final DecisionNavigatorItem child1 = mock(DecisionNavigatorItem.class); final DecisionNavigatorItem child2 = mock(DecisionNavigatorItem.class); final TreeSet<DecisionNavigatorItem> children = asTreeSet(child1, child2); final String uuid = "uuid"; when(item.getUUID()).thenReturn(uuid); when(item.getChildren()).thenReturn(children); presenter.index(item); verify(indexedItems).put(uuid, item); verify(presenter).index(children); }