@Test public void detach() throws Exception { firstPresenter.updateText(TEST_VALUE); firstPresenter.attach(firstFragment); Mockito.verify(firstFragment, Mockito.only()).initialize(TEST_VALUE); assertThat(firstPresenter.hasView()).isTrue(); firstPresenter.detach(firstFragment); firstPresenter.updateText("BLAH"); Mockito.verify(firstFragment, Mockito.only()).initialize(TEST_VALUE); assertThat(firstPresenter.hasView()).isFalse(); }
public void detach(FirstFragment fragment) { this.firstFragment = null; }
FirstPresenter { public void detach(FirstFragment fragment) { this.firstFragment = null; } }
FirstPresenter { public void detach(FirstFragment fragment) { this.firstFragment = null; }  }
FirstPresenter { public void detach(FirstFragment fragment) { this.firstFragment = null; }  void attach(FirstFragment fragment); boolean hasView(); void detach(FirstFragment fragment); void updateText(String text); void restore(StateBundle stateBundle); StateBundle persist(); }
FirstPresenter { public void detach(FirstFragment fragment) { this.firstFragment = null; }  void attach(FirstFragment fragment); boolean hasView(); void detach(FirstFragment fragment); void updateText(String text); void restore(StateBundle stateBundle); StateBundle persist();  }