@Test
public void testProgressivelyDiscardUnknownEmptyFrame() throws Exception {

    short type = 5;
    byte flags = (byte) 0xFF;
    int segment = 4;
    int length = 2 * segment;
    ByteBuf header = Unpooled.buffer(SPDY_HEADER_SIZE);
    ByteBuf segment1 = Unpooled.buffer(segment);
    ByteBuf segment2 = Unpooled.buffer(segment);
    encodeControlFrameHeader(header, type, flags, length);
    segment1.writeInt(RANDOM.nextInt());
    segment2.writeInt(RANDOM.nextInt());
    decoder.decode(header);
    decoder.decode(segment1);
    decoder.decode(segment2);
    verifyZeroInteractions(delegate);
    assertFalse(header.isReadable());
    assertFalse(segment1.isReadable());
    assertFalse(segment2.isReadable());
    header.release();
    segment1.release();
    segment2.release();
}