TagsPresenter extends BasePresenter<TagsView> { @Override public void onViewCreated() { if (changeListener == null) { throw new IllegalStateException("OnTagsChangeListener is not specified"); } refreshTags(); } @Inject  TagsPresenter(TagsManager tagsManager); @Override void onViewCreated();  }
@Test(expected = IllegalStateException.class) public void onViewCreatedWithNoChangeListener() throws Exception { presenter.onViewCreated(); }
@Test public void onViewCreated() throws Exception { presenter.setChangeListener(changeListener); presenter.onViewCreated(); verify(view).updateTags(anyList()); }