### Question:
WebsocketProtocolServer implements ProtocolServer { @Override public CompletableFuture<Void> stop() { if (serverChannel == null) { return completedFuture(null); } return runAsync(() -> { serverChannel.close().syncUninterruptibly(); serverBossGroup.shutdownGracefully().syncUninterruptibly(); serverWorkerGroup.shutdownGracefully().syncUninterruptibly(); serverChannel = null; }); } WebsocketProtocolServer(Config config);   WebsocketProtocolServer(ServerBootstrap serverBootstrap,
                            EventLoopGroup serverBossGroup,
                            EventLoopGroup serverWorkerGroup,
                            Map<String, ExposedThing> things,
                            List<String> addresses,
                            int bindPort,
                            Channel serverChannel); @Override CompletableFuture<Void> start(Servient servient); @Override CompletableFuture<Void> stop(); @Override CompletableFuture<Void> expose(ExposedThing thing); @Override CompletableFuture<Void> destroy(ExposedThing thing);  }### Answer:
@Test public void stopShouldCloseServer() { WebsocketProtocolServer server = new WebsocketProtocolServer(serverBootstrap, serverBossGroup, serverWorkerGroup, things, addresses, bindPort, serverChannel); server.stop(); verify(serverChannel, timeout(1 * 1000L)).close(); }