Presenter { protected void onDestroy() { }  void restore(); void addOnDestroyListener(OnDestroyListener listener); void removeOnDestroyListener(OnDestroyListener listener); @Nullable View getView(); void create(Bundle bundle); void destroy(); void save(Bundle state); void takeView(View view); void dropView();  }
@Test public void testOnDestroy() throws Exception { Presenter.OnDestroyListener listener = mock(Presenter.OnDestroyListener.class); Presenter presenter = new Presenter(); presenter.create(null); presenter.addOnDestroyListener(listener); presenter.destroy(); verify(listener, times(1)).onDestroy(); verifyNoMoreInteractions(listener); }