Ignoring implements State { @Override public State buffer(final HttpMessage message, final HttpContent content) { buffering.buffer(message, content); return this; }  @Override State with(); @Override State buffer(final HttpMessage message, final HttpContent content);  }
@Test void shouldKeepBufferingWhenIgnoring() { state.updateAndGet(State::with); state.updateAndGet(state -> state.buffer(request, content("foo"))); state.updateAndGet(State::without); state.updateAndGet(state -> state.buffer(request, content("bar"))); state.updateAndGet(State::with); final String body = new String(state.get().getBody(), UTF_8); Assertions.assertEquals("foobar", body); }