PopularStreamRepository { public Observable<List<MoviePoster>> getPopularPosters() { return popularStreamApiDatasource.getPopularPosters() .map(toMoviePosters()) .observeOn(observeScheduler) .subscribeOn(subscribeScheduler); } @Inject  PopularStreamRepository(PopularStreamApiDatasource popularStreamApiDatasource,
                                   Map<Threading, Scheduler> schedulerMap,
                                   Converter<ApiMoviePoster, MoviePoster> posterConverter); Observable<List<MoviePoster>> getPopularPosters();  }
@Test public void shouldReturnMoviePosters() throws Exception { ApiMoviePoster firstPoster = createApiMoviePoster(FIRST_MOVIE_ID, FIRST_POSTER_PATH); ApiMoviePoster secondPoster = createApiMoviePoster(SECOND_MOVIE_ID, SECOND_POSTER_PATH); givenApiDataSourceReturns(firstPoster, secondPoster); givenConverterConvertsPosters(firstPoster, secondPoster); Observable<List<MoviePoster>> popularPosters = streamRepository.getPopularPosters(); TestSubscriber<List<MoviePoster>> testSubscriber = new TestSubscriber<>(); popularPosters.subscribe(testSubscriber); List<MoviePoster> moviePosters = Lists.newArrayList( new MoviePoster(FIRST_MOVIE_ID, FIRST_POSTER_PATH), new MoviePoster(SECOND_MOVIE_ID, SECOND_POSTER_PATH) ); testSubscriber.assertValue(moviePosters); }