### Question:
NettyRestServer extends NettyServerBase { public ChannelHandler getHandler() { return handler; } NettyRestServer(InetSocketAddress address, int workerCount);  NettyRestServer(String serviceName, InetSocketAddress address, int workerCount); ChannelHandler getHandler(); void setHandler(ChannelHandler handler); @Override void start();  }### Answer:
@Test public void testNettyRestServerCreation() throws Exception { ResourceConfig resourceConfig = ResourceConfig.forApplicationClass(TestApplication1.class); ServerSocket serverSocket = new ServerSocket(0); int availPort = serverSocket.getLocalPort(); serverSocket.close(); URI baseUri = new URI("http: NettyRestServer restServer = NettyRestServerFactory.createNettyRestServer(baseUri, resourceConfig, 3); assertNotNull(restServer); assertNotNull(restServer.getHandler()); assertNotNull(restServer.getChannel()); assertNotNull(restServer.getListenAddress()); InetSocketAddress listeningAddress = restServer.getListenAddress(); assertEquals(availPort, listeningAddress.getPort()); }