@Test
public void prefaceUserEventProcessed() throws Exception {

    final CountDownLatch latch = new CountDownLatch(1);
    handler = new Http2ConnectionHandler(decoder, encoder, new Http2Settings()) {
        @Override
        public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
            if (evt == Http2ConnectionPrefaceAndSettingsFrameWrittenEvent.INSTANCE) {
                latch.countDown();
            }
        }
    };
    handler.handlerAdded(ctx);
    assertTrue(latch.await(5, SECONDS));
}