### Question:
UpdateUtilImpl implements UpdateUtil { public long getCheckSum(FileWrapper f) { String absPath = f.getAbsolutePath(); Long result = -1L; if (fileChecksumMap.containsKey(absPath)) { result = fileChecksumMap.get(absPath); } else { try { result = _iou.getCheckSum(f); } catch (IOException e) { s_log.error("getCheckSum: failed to compute the checksum for file (" + f.getAbsolutePath() + "): " + e.getMessage(), e); } fileChecksumMap.put(absPath, result); } return result; }  void setPathUtils(PathUtils pathUtils); void setFileWrapperFactory(FileWrapperFactory factory); void setApplicationFileWrappers(ApplicationFileWrappers appFileWrappers); void setIOUtilities(IOUtilities iou); void setUpdateXmlSerializer(UpdateXmlSerializer serializer); long getCheckSum(FileWrapper f); ChannelXmlBean downloadCurrentRelease(final String host, final int port, final String path,
		final String fileToGet, final IProxySettings proxySettings); ChannelXmlBean loadUpdateFromFileSystem(final String path); boolean downloadLocalUpdateFile(String fileToGet, String destDir); void copyFile(final FileWrapper from, final FileWrapper to); @Override void moveFiles(FileWrapper fromDir, String filePattern, boolean matchPattern, FileWrapper toDir); void copyDir(FileWrapper fromDir, FileWrapper toDir); @Override void copyDir(FileWrapper fromDir, String filePattern, boolean matchPattern, FileWrapper toDir); ChannelXmlBean getLocalReleaseInfo(String localReleaseFile); FileWrapper getSquirrelHomeDir(); FileWrapper getInstalledSquirrelMainJarLocation(); FileWrapper getSquirrelPluginsDir(); FileWrapper getSquirrelLibraryDir(); FileWrapper getSquirrelUpdateDir(); FileWrapper getDownloadsDir(); FileWrapper getCoreDownloadsDir(); FileWrapper getPluginDownloadsDir(); FileWrapper getI18nDownloadsDir(); FileWrapper getBackupDir(); FileWrapper getCoreBackupDir(); FileWrapper getI18nBackupDir(); FileWrapper getPluginBackupDir(); FileWrapper getChangeListFile(); void saveChangeList(List<ArtifactStatus> changes); ChangeListXmlBean getChangeList(); FileWrapper getLocalReleaseFile(); List<ArtifactStatus> getArtifactStatus(ChannelXmlBean channelXmlBean); List<ArtifactStatus> getArtifactStatus(ReleaseXmlBean releaseXmlBean); Set<String> getInstalledPlugins(); Set<String> getInstalledTranslations(); IPluginManager getPluginManager(); void setPluginManager(IPluginManager manager); FileWrapper checkDir(FileWrapper parent, String child); void createZipFile(FileWrapper zipFile, FileWrapper... sourceFiles); boolean deleteFile(FileWrapper path); void extractZipFile(FileWrapper zipFile, FileWrapper outputDirectory); ChangeListXmlBean getChangeList(FileWrapper changeListFile); FileWrapper getFile(FileWrapper installDir, String artifactName); String downloadHttpUpdateFile(final String host, final int port, final String fileToGet,
		final String destDir, final long fileSize, final long checksum, final IProxySettings proxySettings); FileWrapper getDownloadFileLocation(ArtifactStatus status); boolean isPresentInDownloadsDirectory(ArtifactStatus status); UpdateCheckFrequency getUpdateCheckFrequency(IUpdateSettings settings); final static int ZIP_EXTRACTION_BUFFER_SIZE; }### Answer:
@Test public void testGetCheckSum() throws IOException { FileWrapper mockFile = mockHelper.createMock("mockFile", FileWrapper.class); expect(mockFile.getAbsolutePath()).andReturn("/path/To/Mock/File"); expect(mockIOUtilities.getCheckSum(mockFile)).andReturn(1000L); mockHelper.replayAll(); long checksumResult = underTest.getCheckSum(mockFile); mockHelper.verifyAll(); assertEquals(1000L, checksumResult); }