### Question:
WMSEnvoyHelper { public static WMSServerCapabilities requestCapabilitiesFromServer(ServerConnectionParams serverConf, Toolbox toolbox) throws IOException, GeneralSecurityException, InterruptedException, URISyntaxException { byte[] bytes; try { bytes = requestCapabilities(serverConf, toolbox, "1.3.0", false); } catch (IOException | InterruptedException e) { bytes = requestCapabilities(serverConf, toolbox, "1.1.1", true); } final InputStream stream = new ByteArrayInputStream(bytes); WMSCapabilities caps130; try { caps130 = getXmlObject(stream, WMSCapabilities.class, handler -> new NamespaceContentHandler(handler)); } catch (final IOException e) { caps130 = null; } if (caps130 != null && caps130.getCapability() != null && "1.3.0".equals(caps130.getVersion())) { return new WMS130Capabilities(caps130); } stream.reset(); final WMTMSCapabilities caps111 = getXmlObject(stream, WMTMSCapabilities.class, null); if (caps111 != null && caps111.getCapability() != null) { return new WMS111Capabilities(caps111); } return null; } private  WMSEnvoyHelper(); static Image getImageFromServer(SldRegistry sldRegistry, ServerConnectionParams serverConfig,
            WMSLayerConfig layerConfig, TileImageKey imageKey, Toolbox toolbox, String wmsVersion); static InputStream getImageStreamFromServer(SldRegistry sldRegistry, ServerConnectionParams serverConfig,
            WMSLayerConfig layerConfig, TileImageKey imageKey, Toolbox toolbox, String wmsVersion); static WMSServerCapabilities requestCapabilitiesFromServer(ServerConnectionParams serverConf, Toolbox toolbox);  }### Answer:
@Test public void testRequestCapabilitiesFromServer() throws IOException, URISyntaxException, GeneralSecurityException, InterruptedException { EasyMockSupport support = new EasyMockSupport(); ServerConnectionParams params = createParams(support); Toolbox toolbox = createToolbox(support); support.replayAll(); WMSServerCapabilities capabilities = WMSEnvoyHelper.requestCapabilitiesFromServer(params, toolbox); assertNotNull(capabilities); assertEquals("1.1.1", capabilities.getVersion()); support.verifyAll(); }