PresenterLifeCycleLinker { public void updatePresenters(RosiePresenter.View view) { if (view == null) { throw new IllegalArgumentException( "The view instance used to update the presenters can't be null"); } for (RosiePresenter presenter : presenters) { presenter.setView(view); presenter.update(); } }  void initializeLifeCycle(Object source, RosiePresenter.View view); void initializePresenters(); void updatePresenters(RosiePresenter.View view); void pausePresenters(); void destroyPresenters(); void registerPresenter(RosiePresenter presenter); void setView(RosiePresenter.View view);  }
@Test public void shouldCallAllRegisteredPresentersAreCalledWhenUpdateIsCalled() { PresenterLifeCycleLinker presenterLifeCycleLinker = givenAPresenterLifecycleLinker(anyPresenter1, anyPresenter2); presenterLifeCycleLinker.updatePresenters(anyView); verify(anyPresenter1).update(); verify(anyPresenter2).update(); }
@Test public void shouldUpdateThePresentersViewWhenUpdateIsCalled() { RosiePresenter presenter = givenAnyPresenter(); PresenterLifeCycleLinker presenterLifeCycleLinker = givenAPresenterLifecycleLinker(presenter); presenterLifeCycleLinker.updatePresenters(anyView); assertEquals(anyView, presenter.getView()); }