### Question:
PhotoRepository implements PhotoDataSource { @Override public void savePhoto(@NonNull Photo photo) { photoLocalDataSource.savePhoto(photo); cachedPhotos.put(photo.getPhotoId(), photo); } PhotoRepository(@NonNull PhotoDataSource photoRemoteDataSource,
                           @NonNull PhotoDataSource photoLocalDataSource); @Override void getPhotos(@NonNull LoadPhotosCallback callback); @Override void getPhoto(int photoId, @NonNull LoadPhotoCallback callback); @Override void savePhoto(@NonNull Photo photo); @Override void deletePhoto(int photoId); @Override void deleteAllPhotos(); @Override void refreshPhotos();  }### Answer:
@Test public void savePhoto_shouldSavePhotoToCacheAndLocal() { final Photo photo = new Photo(1, 10, "a"); repository.savePhoto(photo); verify(remoteDataSource, never()).savePhoto(photo); verify(localDataSource, times(1)).savePhoto(photo); assertThat(repository.cachedPhotos.size(), is(1)); }