### Question:
UpdateUtilImpl implements UpdateUtil { public Set<String> getInstalledPlugins() { HashSet<String> result = new HashSet<String>(); for (PluginInfo info : _pluginManager.getPluginInformation()) { result.add(info.getInternalName() + "-assembly.zip"); } 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 testGetInstalledPlugins() { PluginInfo[] pluginInfos = new PluginInfo[2]; PluginInfo mockPlugin1 = mockHelper.createMock(PluginInfo.class); PluginInfo mockPlugin2 = mockHelper.createMock(PluginInfo.class); EasyMock.expect(mockPlugin1.getInternalName()).andReturn("plugin1"); EasyMock.expect(mockPlugin2.getInternalName()).andReturn("plugin2"); pluginInfos[0] = mockPlugin1; pluginInfos[1] = mockPlugin2; expect(mockPluginManager.getPluginInformation()).andReturn(pluginInfos); mockHelper.replayAll(); Set<String> installedPlugins = underTest.getInstalledPlugins(); mockHelper.verifyAll(); assertEquals(2, installedPlugins.size()); }