HttpConnectionReleaseDownloader extends AbstractReleaseDownloader { @WorkerThread synchronized void setDownloadedReleaseFilePath(String downloadedReleaseFilePath) { if (isCancelled()) { return; } if (downloadedReleaseFilePath != null) { SharedPreferencesManager.putString(PREFERENCE_KEY_DOWNLOADED_RELEASE_FILE, downloadedReleaseFilePath); } else { SharedPreferencesManager.remove(PREFERENCE_KEY_DOWNLOADED_RELEASE_FILE); } } HttpConnectionReleaseDownloader(@NonNull Context context, @NonNull ReleaseDetails releaseDetails, @NonNull Listener listener); @Override synchronized boolean isDownloading(); @AnyThread @Override synchronized void resume(); @Override synchronized void cancel();  }
@Test public void setDownloadedReleaseFilePath() { String downloadedReleaseFile = "/path/to/file"; mReleaseDownloader.setDownloadedReleaseFilePath(downloadedReleaseFile); verifyStatic(); SharedPreferencesManager.putString(eq(PREFERENCE_KEY_DOWNLOADED_RELEASE_FILE), eq(downloadedReleaseFile)); mReleaseDownloader.setDownloadedReleaseFilePath(null); verifyStatic(); SharedPreferencesManager.remove(eq(PREFERENCE_KEY_DOWNLOADED_RELEASE_FILE)); }