LynxPresenter implements Lynx.Listener { public void resume() { if (!isInitialized) { isInitialized = true; lynx.registerListener(this); lynx.startReading(); } } LynxPresenter(Lynx lynx, View view, int maxNumberOfTracesToShow); void setLynxConfig(LynxConfig lynxConfig); void resume(); void pause(); @Override void onNewTraces(List<Trace> traces); void updateFilter(String filter); void updateFilterTraceLevel(TraceLevel level); void onShareButtonClicked(); void onScrollToPosition(int lastVisiblePositionInTheList); List<Trace> getCurrentTraces();  }
@Test public void shouldRegisterItselfAsLynxListenerOnResume() { presenter.resume(); verify(lynx).registerListener(presenter); }
@Test public void shouldStartLynxOnResume() { presenter.resume(); verify(lynx).startReading(); }
@Test public void shouldNotStartReadingFromLynxIfPresenterIsAlreadyInitialized() { presenter.resume(); presenter.resume(); verify(lynx).startReading(); verify(lynx).registerListener(presenter); }