GuidedDecisionTableAccordion { public void clear() { getItems().clear(); getView().clear(); } @Inject  GuidedDecisionTableAccordion(final View view,
                                        final ManagedInstance<GuidedDecisionTableAccordionItem> itemManagedInstance); @PostConstruct void setup(); View getView(); void addItem(final GuidedDecisionTableAccordionItem.Type type,
                        final Widget widget); void clear(); GuidedDecisionTableAccordionItem getItem(final GuidedDecisionTableAccordionItem.Type type);  }
@Test public void testClear() throws Exception { final List<GuidedDecisionTableAccordionItem> itemsList = spy(new ArrayList<>()); when(accordion.getItems()).thenReturn(itemsList); accordion.clear(); verify(itemsList).clear(); verify(view).clear(); }