### Question:
PermalinkUrlProviderImpl implements PermalinkUrlProvider { @Override public String getPermalinkUrl(String host) { String permalinkUrl = null; String serverName = null; for (ServerConnectionParams params : myServerListManager.getActiveServers()) { ServerConfiguration configuration = params.getServerConfiguration(); if (configuration != null && host.equals(configuration.getHost())) { serverName = params.getServerTitle(); break; } } if (StringUtils.isNotEmpty(serverName)) { for (ServerSourceController controller : myControllerManager.getControllers()) { for (IDataSource server : controller.getSourceList()) { if (server instanceof OGCServerSource) { OGCServerSource ogcServer = (OGCServerSource)server; if (StringUtils.equals(serverName, ogcServer.getName())) { permalinkUrl = ogcServer.getPermalinkUrl(); break; } } } if (StringUtils.isNotEmpty(permalinkUrl)) { break; } } } return permalinkUrl; } PermalinkUrlProviderImpl(ServerSourceControllerManager controllerManager, ServerListManager serverListManager); @Override String getPermalinkUrl(String host);  }### Answer:
@Test public void testGetPermalinkUrl() { EasyMockSupport support = new EasyMockSupport(); ServerSourceController controller = createController(support); ServerSourceControllerManager controllerManager = createManager(support, controller); ServerListManager listManager = createServerManager(support); support.replayAll(); PermalinkUrlProviderImpl provider = new PermalinkUrlProviderImpl(controllerManager, listManager); String permalink = provider.getPermalinkUrl(ourHost); assertEquals(ourPermalink, permalink); support.verifyAll(); }