### Question:
ServerBootstrap extends Bootstrap { public Channel bind() { SocketAddress localAddress = (SocketAddress) getOption("localAddress"); if (localAddress == null) { throw new IllegalStateException("localAddress option is not set."); } return bind(localAddress); } ServerBootstrap();  ServerBootstrap(ChannelFactory channelFactory); @Override void setFactory(ChannelFactory factory); ChannelHandler getParentHandler(); void setParentHandler(ChannelHandler parentHandler); Channel bind(); Channel bind(final SocketAddress localAddress); ChannelFuture bindAsync(); ChannelFuture bindAsync(final SocketAddress localAddress);  }### Answer:
@Test public void testBind() { ServerBootstrap bootstrap = newBootstrap(); bootstrap.setFactory(new NioServerSocketChannelFactory()); Channel channel = bootstrap.bind(new InetSocketAddress(0)); channel.close().awaitUninterruptibly(); }