SelectionCardPresenter implements SelectableTextView.OnWordSelectedListener { public void removeView() { this.selectionCardView = null; } @Inject  SelectionCardPresenter(SelectionCardController controller, ContextHelper contextHelper); @Override void onWordSelected(String word); void onClipTextChanged(@NonNull String clipText); void addView(SelectionCardView selectionCardView); void removeView(); void onDefineClicked(); void onSearchClicked(); void onCopyClicked(); void onWikiClicked(); void onShareClicked(); void onSettingsClicked(); static boolean isLessThanNWords(String text, int n);  }
@Test public void testRemoveView() throws Exception { String clipText = "The whole cliptext"; presenter.addView(selectionCardView); presenter.onClipTextChanged(clipText); verify(selectionCardView).setTextForSelection(clipText); reset(selectionCardView); presenter.removeView(); presenter.onClipTextChanged(clipText); verify(selectionCardView, never()).setTextForSelection(clipText); }