ShotsRepository implements ShotsDataSource { private void getListShotsFromRemote(final int filterId, final LoadListShotsCallback callback){ mShotsRemoteDataSource.getListShots(filterId,new LoadListShotsCallback() { @Override public void onListShotsLoaded(List<Shots> shotsList) { mCachedShots.put(filterId,shotsList); mCacheIsDirty=false; mShotsLocalDataSource.deleteAllShots(); mShotsLocalDataSource.saveListShots(shotsList); callback.onListShotsLoaded(shotsList); } @Override public void onDataNotAvailable() { callback.onDataNotAvailable(); } }); } private  ShotsRepository(@NonNull ShotsDataSource shotsLocalDataSource,
                           @NonNull ShotsDataSource shotsRemoteDataSource); static ShotsRepository getInstance(ShotsDataSource shotsLocalDataSource,
                                              ShotsDataSource shotsRemoteDataSource); static void destroyInstance(); @Override void getListShots(final int filterId, @NonNull final LoadListShotsCallback callback); @Override void getListShotsByPage(int page, int filterId, @NonNull LoadListShotsCallback callback); @Override void deleteAllShots(); @Override void refreshShots(); @Override void getShots(@NonNull int shotsId, @NonNull GetShotsCallback callback); @Override void saveListShots(List<Shots> shotsList);  }
@Test public void getListShotsFromRemote(){ shotsRepository.refreshShots(); shotsRepository.getListShots(0,loadListShotsCallback); verify(shotsRemoteDataSource).getListShots(eq(0),loadListShotsCallbackArgumentCaptor.capture()); loadListShotsCallbackArgumentCaptor.getValue().onListShotsLoaded(new ArrayList<Shots>()); verify(shotsLocalDataSource).saveListShots(listArgumentCaptor.capture()); Assert.assertEquals(0,listArgumentCaptor.getValue().size()); }