### Question:
CloudUserDataStore implements UserDataStore { @Override public Observable<UserEntity> userEntityDetails(final int userId) { return this.restApi.userEntityById(userId).doOnNext(CloudUserDataStore.this.userCache::put); } CloudUserDataStore(RestApi restApi, UserCache userCache); @Override Observable<List<UserEntity>> userEntityList(); @Override Observable<UserEntity> userEntityDetails(final int userId);  }### Answer:
@Test public void testGetUserEntityDetailsFromApi() { UserEntity fakeUserEntity = new UserEntity(); Observable<UserEntity> fakeObservable = Observable.just(fakeUserEntity); given(mockRestApi.userEntityById(FAKE_USER_ID)).willReturn(fakeObservable); cloudUserDataStore.userEntityDetails(FAKE_USER_ID); verify(mockRestApi).userEntityById(FAKE_USER_ID); }