### Question:
CoapProtocolServer implements ProtocolServer { @Override public URI getDirectoryUrl() { try { return new URI(actualAddresses.get(0)); } catch (URISyntaxException e) { log.warn("Unable to create directory url", e); return null; } } CoapProtocolServer(Config config); @SuppressWarnings({ "java:S107" })  CoapProtocolServer(String bindHost,
                       int bindPort,
                       List<String> addresses,
                       Map<String, ExposedThing> things,
                       Map<String, CoapResource> resources,
                       Supplier<WotCoapServer> serverSupplier,
                       WotCoapServer server,
                       int actualPort,
                       List<String> actualAddresses); @Override String toString(); @Override CompletableFuture<Void> start(Servient servient); @Override CompletableFuture<Void> stop(); @Override CompletableFuture<Void> expose(ExposedThing thing); @Override CompletableFuture<Void> destroy(ExposedThing thing); @Override URI getDirectoryUrl(); @Override URI getThingUrl(String id); int getBindPort(); Map<String, ExposedThing> getThings();  }### Answer:
@Test public void getDirectoryUrlShouldReturnFristAddress() throws URISyntaxException { when(addresses.get(0)).thenReturn("coap: CoapProtocolServer server = new CoapProtocolServer(bindHost, bindPort, addresses, things, resources, serverSupplier, coapServer, bindPort, addresses); assertEquals(new URI("coap: }