### Question:
NettyResponseChannel implements RestResponseChannel { void setRequest(NettyRequest request) { if (request != null) { if (this.request == null) { this.request = request; HttpUtil.setKeepAlive(responseMetadata, request.isKeepAlive()); } else { throw new IllegalStateException( "Request has already been set inside NettyResponseChannel for channel {} " + ctx.channel()); } } else { throw new IllegalArgumentException("RestRequest provided is null"); } } NettyResponseChannel(ChannelHandlerContext ctx, NettyMetrics nettyMetrics, PerformanceConfig performanceConfig,
      NettyConfig nettyConfig); @Override Future<Long> write(ByteBuffer src, Callback<Long> callback); @Override Future<Long> write(ByteBuf src, Callback<Long> callback); @Override boolean isOpen(); @Override void close(); @Override void onResponseComplete(Exception exception); @Override void setStatus(ResponseStatus status); @Override ResponseStatus getStatus(); @Override void setHeader(String headerName, Object headerValue); @Override Object getHeader(String headerName); final ChannelFutureListener DELAYED_CLOSE; }### Answer:
@Test public void setRequestTest() { HttpRequest request = createRequestWithHeaders(HttpMethod.GET, TestingUri.SetRequest.toString()); HttpUtil.setKeepAlive(request, false); EmbeddedChannel channel = createEmbeddedChannel(); channel.writeInbound(request); HttpResponse response = channel.readOutbound(); assertEquals("Unexpected response status", HttpResponseStatus.ACCEPTED, response.status()); assertFalse("Channel not closed on the server", channel.isActive()); }