### Question:
WPSStreamingServerHandler { public void close() { if (myServer != null) { ServerProvider<StreamingServer> provider = myProviderRegistry.getProvider(StreamingServer.class); if (provider instanceof ModifiableServerProvider) { ((ModifiableServerProvider<StreamingServer>)provider).removeServer(myServer); } } } WPSStreamingServerHandler(WPSCapabilitiesType capabilities, ServerProviderRegistry providerRegistry,
            ComponentsFactory factory); void close();  }### Answer:
@Test public void test() throws MalformedURLException { EasyMockSupport support = new EasyMockSupport(); WPSCapabilitiesType capabilities = createStreamingCapabilities(); MockServerProvider provider = new MockServerProvider(); ServerProviderRegistry registry = createProviderRegistry(support, provider); ComponentsFactory factory = createFactory(support); support.replayAll(); WPSStreamingServerHandler handler = new WPSStreamingServerHandler(capabilities, registry, factory); WPSStreamingServer server = (WPSStreamingServer)provider.getAddedServer(); assertEquals(ourUrl, server.getURL().toString()); handler.close(); assertNull(provider.getAddedServer()); support.verifyAll(); }
@Test public void testNonStreamingServer() { EasyMockSupport support = new EasyMockSupport(); WPSCapabilitiesType capabilities = createNonStreamingCapabilities(); MockServerProvider provider = new MockServerProvider(); ServerProviderRegistry registry = support.createMock(ServerProviderRegistry.class); ComponentsFactory factory = support.createNiceMock(ComponentsFactory.class); support.replayAll(); WPSStreamingServerHandler handler = new WPSStreamingServerHandler(capabilities, registry, factory); assertNull(provider.getAddedServer()); handler.close(); support.verifyAll(); }