source: class MovieListPresenterTest {
  
      @Rule
      public MockitoRule mockitoRule;
      @Mock MovieListContract.View view;
      @Mock TmdbApi api;
      @Mock AppSettings appSettings;
      @Inject Gson gson;
      @InjectMocks MovieListPresenter presenter;
  
      @Test
      public void startPresenterWithPopularSortOrder() {
  
target:         when(appSettings.getSortOrder()).thenReturn(new SortOrder(SortOrder.POPULAR));
  
          MovieListApiResponse popularMovies = MockResponse.getPopularMovies(gson);
  
          when(api.popular(null))
                  .thenReturn(Single.just(popularMovies));
  
          presenter.start();
  
          verify(api).popular(null);
          verify(view).showLoading();
      }
  
  }