### Question:
NioServerSocketChannel extends AbstractNioMessageChannel implements io.netty.channel.socket.ServerSocketChannel { @Override protected boolean closeOnReadError(Throwable cause) { return super.closeOnReadError(cause); } NioServerSocketChannel();  NioServerSocketChannel(ServerSocketChannel channel);  NioServerSocketChannel(SelectorProvider provider); @Override InetSocketAddress localAddress(); @Override InetSocketAddress remoteAddress(); @Override ChannelMetadata metadata(); @Override ServerSocketChannelConfig config(); @Override boolean isActive();  }### Answer:
@Test public void testCloseOnError() throws Exception { ServerSocketChannel jdkChannel = ServerSocketChannel.open(); NioServerSocketChannel serverSocketChannel = new NioServerSocketChannel(jdkChannel); EventLoopGroup group = new NioEventLoopGroup(1); try { group.register(serverSocketChannel).syncUninterruptibly(); serverSocketChannel.bind(new InetSocketAddress(0)).syncUninterruptibly(); Assert.assertFalse(serverSocketChannel.closeOnReadError(new IOException())); Assert.assertTrue(serverSocketChannel.closeOnReadError(new IllegalArgumentException())); serverSocketChannel.close().syncUninterruptibly(); } finally { group.shutdownGracefully(); } }