@Test
public void unknownFrameTypeShouldThrowAndBeReleased() throws Exception {

    class UnknownHttp2Frame extends AbstractReferenceCounted implements Http2Frame {
        @Override
        public String name() {
            return "UNKNOWN";
        }
        @Override
        protected void deallocate() {
        }
        @Override
        public ReferenceCounted touch(Object hint) {
            return this;
        }
    }
    UnknownHttp2Frame frame = new UnknownHttp2Frame();
    assertEquals(1, frame.refCnt());
    ChannelFuture f = channel.write(frame);
    f.await();
    assertTrue(f.isDone());
    assertFalse(f.isSuccess());
    assertThat(f.cause(), instanceOf(UnsupportedMessageTypeException.class));
    assertEquals(0, frame.refCnt());
}