@Test
public void addNamedDecoderReplaysLastHttp() {

	ByteBuf buf = Unpooled.copiedBuffer("{\"foo\":1}", CharsetUtil.UTF_8);
	EmbeddedChannel channel = new EmbeddedChannel();
	new HttpClientOperations(() -> channel, ConnectionObserver.emptyListener(),
			ClientCookieEncoder.STRICT, ClientCookieDecoder.STRICT)
			.addHandler("json", new JsonObjectDecoder());
	channel.writeInbound(new DefaultLastHttpContent(buf));
	MatcherAssert.assertThat(channel.pipeline().names().iterator().next(), is("json$extractor"));
	Object content = channel.readInbound();
	MatcherAssert.assertThat(content, instanceOf(ByteBuf.class));
	((ByteBuf) content).release();
	content = channel.readInbound();
	MatcherAssert.assertThat(content, instanceOf(LastHttpContent.class));
	((LastHttpContent) content).release();
	MatcherAssert.assertThat(channel.readInbound(), nullValue());
}