### Question:
FileDownloader { private static String downloadFile(String url, String checksum, String algorithm) { Preconditions.checkArgument(StringUtils.isNotBlank(algorithm), "Invalid Algorithm: Cannot be null or empty"); String filename = decideFilePath(url.substring(url.lastIndexOf("/") + 1)); if (new File(filename).exists()) { if (checkLocalFile(filename, checksum, algorithm)) { return filename; } } LOGGER.fine("Downloading from " + url + " with checksum " + checksum + "[" + algorithm + "]"); try { FileUtils.copyURLToFile(new URL(url), new File(filename), 10000, 60000); } catch (IOException e) { LOGGER.log(Level.SEVERE, e.getMessage(), e); } if (checkLocalFile(filename, checksum, algorithm)) { return filename; } return null; } private  FileDownloader();   }### Answer:
@Test(expectedExceptions = { UnsupportedOperationException.class }, groups = { "downloads-dependencies" }) public void testUnsupportedFileType() { String unsupportedFileURL = "https: FileDownloader.downloadFile(unsupportedFileURL, "123CEFRGxSdfnsfwefla"); }
@Test(groups = { "downloads-dependencies" }) public void testFileDownload() { String testUrl = "https: String tempChecksum = "dde210e04e5c1b0d6019fd8a1199df18"; String result = FileDownloader.downloadFile(testUrl, tempChecksum); downloadedFile = new File(result); assertTrue(downloadedFile.exists()); }
@Test(groups = { "downloads-dependencies" }) public void testInvalidChecksum() { String testUrl = "https: String tempChecksum = "dde210e04e5c1b0d6019fd8a1199df18"; String result = FileDownloader.downloadFile(testUrl, tempChecksum); assertNull(result); }