PresenterLifeCycleLinker { public void setView(RosiePresenter.View view) { if (view == null) { throw new IllegalArgumentException( "The view instance used to configure the presenters can't be null"); } for (RosiePresenter presenter : presenters) { presenter.setView(view); } }  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 shouldUpdateThePresentersViewWhenSetViewIsCalled() { RosiePresenter presenter = givenAnyPresenter(); PresenterLifeCycleLinker presenterLifeCycleLinker = givenAPresenterLifecycleLinker(presenter); presenterLifeCycleLinker.setView(anyView); assertEquals(anyView, presenter.getView()); }
@Test(expected = IllegalArgumentException.class) public void shouldNotAcceptNullViewsToConfigureThePresenters() { PresenterLifeCycleLinker presenterLifeCycleLinker = givenAPresenterLifecycleLinker(); presenterLifeCycleLinker.setView(null); }