PopupPresenter extends Presenter<Popup<D, R>> { public void dismiss() { if (whatToShow != null) { whatToShow = null; if (!hasView()) return; Popup<D, R> popUp = getView(); if (popUp.isShowing()) popUp.dismiss(WITH_FLOURISH); } } protected  PopupPresenter(String customStateKey); protected  PopupPresenter(); D showing(); void show(D info); void dismiss(); final void onDismissed(R result); @Override void dropView(Popup<D, R> view); @Override void onLoad(Bundle savedInstanceState); @Override void onSave(Bundle outState); @Override void onExitScope();  }
@Test public void dismissWithoutShowDoesNotDismissView() { presenter.takeView(view); presenter.dismiss(); verify(view, never()).dismiss(anyBoolean()); }
@Test public void destroyDismissesWithoutFlourish() { presenter.takeView(view); when(view.isShowing()).thenReturn(true); activityScope.destroy(); verify(view).dismiss(eq(WITHOUT_FLOURISH)); }