@Test(timeout = 1000)
public void newOutboundStream() {

    final Http2FrameStream stream = frameCodec.newStream();
    assertNotNull(stream);
    assertFalse(isStreamIdValid(stream.id()));
    final Promise<Void> listenerExecuted = new DefaultPromise<Void>(GlobalEventExecutor.INSTANCE);
    channel.writeAndFlush(new DefaultHttp2HeadersFrame(new DefaultHttp2Headers(), false).stream(stream))
           .addListener(new ChannelFutureListener() {
                @Override
                public void operationComplete(ChannelFuture future) throws Exception {
                    assertTrue(future.isSuccess());
                    assertTrue(isStreamIdValid(stream.id()));
                    listenerExecuted.setSuccess(null);
                }
            }
    );
    ByteBuf data = Unpooled.buffer().writeZero(100);
    ChannelFuture f = channel.writeAndFlush(new DefaultHttp2DataFrame(data).stream(stream));
    assertTrue(f.isSuccess());
    listenerExecuted.syncUninterruptibly();
    assertTrue(listenerExecuted.isSuccess());
}