title: How to test observer?
body: <p>I would test presenter like this:</p>
  
  <pre><code>class MostPopularPresenter @Inject constructor(val mostPopularUseCase: MostPopularUseCase) 
  : Presenter&lt;MostPopularView&gt;() {
  
      fun requestMostPopular(page: Int, update: Boolean) {
          if (page &lt;= 6)
              mostPopularUseCase.execute(MostPopularObserver(), MostPopularUseCase.Params.createQuery(page, 15, update))
      }
  
      inner class MostPopularObserver : DisposableSingleObserver&lt;MostPopularModel&gt;() {
  
          override fun onSuccess(t: MostPopularModel) {
              this@MostPopularPresenter.view?.populateRecyclerList(t)
          }
  
          override fun onError(e: Throwable) {
              this@MostPopularPresenter.view?.showError()
          }
      }
  }
  </code></pre>
  
  <p>I have problem how to mock observer and force it to throw error or return value on success. I'm using mockito/junit. Can someone point me how to achieve it? Maybe my code is untestable?</p>