@Test
public void windowUpdateMayFail() throws Exception {

    frameListener.onHeadersRead(http2HandlerCtx, 3, request, 31, false);
    Http2Connection connection = frameCodec.connection();
    Http2Stream stream = connection.stream(3);
    assertNotNull(stream);
    Http2HeadersFrame inboundHeaders = inboundHandler.readInbound();
    assertNotNull(inboundHeaders);
    Http2FrameStream stream2 = inboundHeaders.stream();
    // Fails, cause trying to return too many bytes to the flow controller
    ChannelFuture f = channel.write(new DefaultHttp2WindowUpdateFrame(100).stream(stream2));
    assertTrue(f.isDone());
    assertFalse(f.isSuccess());
    assertThat(f.cause(), instanceOf(Http2Exception.class));
}