class PostListPresenter implements BasePresenter<PostListPresenter.View> {

  @Override
  public void attachView(View view) {
    mMVPView = view;

    mSubscriptions.add(
        mDataController.getCombinedPosts()
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(onNext -> mMVPView.onSubscribe(onNext), onError -> {}));

  }

}

class PostListPresenterTest  {

    private PostListPresenter mPresenter;
    private List<PostItem> mValidDummyData;
    @Mock private PostListPresenter.View mView;
    @Mock private DataController mDataController;
    private Observable<List<PostItem>> mPostListObservable;

    @Test
    public void givenCombinedPostsReturnsNoList_whenViewIsAttached_shouldNotPassToAdapter() throws Exception {

        //Test when view is attached and data controller emits valid data, onSubscribe should be called from view, which is attached to the adapter
        when(mDataController.getCombinedPosts()).thenReturn(Observable.empty());

        mPresenter = new PostListPresenter(mDataController);
        mPresenter.attachView(mView);

        verify(mView, never()).onSubscribe(anyList());
    }

}