TagsPresenter extends BasePresenter<TagsView> { void onDeleteTag(int pos) { if (pos < tags.size()) { TagWithCount tagWithCount = tags.get(pos); tagsManager.delete(tagWithCount.tag()); refreshTags(); changeListener.onTagsUpdate(); } } @Inject  TagsPresenter(TagsManager tagsManager); @Override void onViewCreated();  }
@Test public void onDeleteTag() throws Exception { presenter.setChangeListener(changeListener); presenter.onViewCreated(); Mockito.reset(view); presenter.onDeleteTag(0); verify(tagsManager).delete(any(Tag.class)); verify(view).updateTags(anyList()); verify(changeListener).onTagsUpdate(); }