class RepoInfoPresenter extends BasePresenter {

    public void onCreateView(Bundle savedInstanceState) {

        if (savedInstanceState != null) {
            contributorList = (List<Contributor>) savedInstanceState.getSerializable(BUNDLE_CONTRIBUTORS_KEY);
            branchList = (List<Branch>) savedInstanceState.getSerializable(BUNDLE_BRANCHES_KEY);
        }

        if (contributorList == null || branchList == null) {
            loadData();
        } else {
            view.showBranches(branchList);
            view.showContributors(contributorList);
        }

    }

}

class RepoInfoPresenterTest extends BasePresenter {

    @Inject
    protected List<ContributorDTO> contributorDTOs;
    @Inject
    protected List<BranchDTO> branchDTOs;
    @Inject
    protected List<Contributor> contributorList;
    @Inject
    protected List<Branch> branchList;
    @Inject
    protected RepoBranchesMapper branchesMapper;
    @Inject
    protected RepoContributorsMapper contributorsMapper;
    @Inject
    protected Model model;
    @Inject
    protected Repository repository;
    private RepoInfoView mockView;
    private RepoInfoPresenter repoInfoPresenter;

    @Test
    public void testShowLoadingOnError() {

        doAnswer(invocation -> Observable.error(new Throwable(TestConst.TEST_ERROR)))
                .when(model)
                .getRepoContributors(TestConst.TEST_OWNER, TestConst.TEST_REPO);
        doAnswer(invocation -> Observable.error(new Throwable(TestConst.TEST_ERROR)))
                .when(model)
                .getRepoBranches(TestConst.TEST_OWNER, TestConst.TEST_REPO);

        repoInfoPresenter.onCreateView(null);

        verify(mockView).showLoading();
    }

}