@Test
public void searchUsers_200OkResponse_InvokesCorrectApiCalls() {

    //Given
    when(githubUserRestService.searchGithubUsers(anyString())).thenReturn(Observable.just(githubUserList()));
    when(githubUserRestService.getUser(anyString()))
            .thenReturn(Observable.just(user1FullDetails()), Observable.just(user2FullDetails()));
    //When
    TestSubscriber<List<User>> subscriber = new TestSubscriber<>();
    userRepository.searchUsers(USER_LOGIN_RIGGAROO).subscribe(subscriber);
    //Then
    subscriber.awaitTerminalEvent();
    subscriber.assertNoErrors();
    List<List<User>> onNextEvents = subscriber.getOnNextEvents();
    List<User> users = onNextEvents.get(0);
    Assert.assertEquals(USER_LOGIN_RIGGAROO, users.get(0).getLogin());
    Assert.assertEquals(USER_LOGIN_2_REBECCA, users.get(1).getLogin());
    verify(githubUserRestService).searchGithubUsers(USER_LOGIN_RIGGAROO);
    verify(githubUserRestService).getUser(USER_LOGIN_RIGGAROO);
    verify(githubUserRestService).getUser(USER_LOGIN_2_REBECCA);
}