// Path: src/main/java/com/twitter/http2/HttpCodecUtil.java
// static final int HTTP_DEFAULT_DEPENDENCY = 0;
// 
// Path: src/main/java/com/twitter/http2/HttpCodecUtil.java
// static final int HTTP_DEFAULT_WEIGHT = 16;
// 
// Path: src/main/java/com/twitter/http2/HttpCodecUtil.java
// static final int HTTP_MAX_LENGTH = 0x4000; // Initial MAX_FRAME_SIZE value is 2^14


import java.util.Random;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import org.junit.Test;
import static io.netty.util.ReferenceCountUtil.releaseLater;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static com.twitter.http2.HttpCodecUtil.HTTP_DEFAULT_DEPENDENCY;
import static com.twitter.http2.HttpCodecUtil.HTTP_DEFAULT_WEIGHT;
import static com.twitter.http2.HttpCodecUtil.HTTP_MAX_LENGTH;
        int streamId = RANDOM.nextInt() & 0x7FFFFFFF | 0x01;
        int promisedStreamId = RANDOM.nextInt() & 0x7FFFFFFF | 0x01;
        ByteBuf headerBlock = Unpooled.buffer(2 * HTTP_MAX_LENGTH);
        for (int i = 0; i < 2 * HTTP_MAX_LENGTH; i++) {
            headerBlock.writeByte(RANDOM.nextInt());
        }
        ByteBuf frame = releaseLater(
                ENCODER.encodePushPromiseFrame(streamId, promisedStreamId, headerBlock.duplicate())
        );
        assertPushPromiseFrame(frame, streamId, promisedStreamId, headerBlock);
    }

    @Test
    public void testHttpPingFrame() throws Exception {
        long data = RANDOM.nextLong();
        ByteBuf frame = releaseLater(
                ENCODER.encodePingFrame(data, false)
        );
        assertPingFrame(frame, false, data);
    }

    @Test
    public void testHttpPongFrame() throws Exception {
        long data = RANDOM.nextLong();
        ByteBuf frame = releaseLater(
                ENCODER.encodePingFrame(data, true)
        );
        assertPingFrame(frame, true, data);
    }

// Path: src/main/java/com/twitter/http2/HttpCodecUtil.java
// static final int HTTP_DEFAULT_DEPENDENCY = 0;
// 
// Path: src/main/java/com/twitter/http2/HttpCodecUtil.java
// static final int HTTP_DEFAULT_WEIGHT = 16;
// 
// Path: src/main/java/com/twitter/http2/HttpCodecUtil.java
// static final int HTTP_MAX_LENGTH = 0x4000; // Initial MAX_FRAME_SIZE value is 2^14


// Path: src/test/java/com/twitter/http2/HttpFrameEncoderTest.java
import java.util.Random;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import org.junit.Test;
import static io.netty.util.ReferenceCountUtil.releaseLater;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static com.twitter.http2.HttpCodecUtil.HTTP_DEFAULT_DEPENDENCY;
import static com.twitter.http2.HttpCodecUtil.HTTP_DEFAULT_WEIGHT;
import static com.twitter.http2.HttpCodecUtil.HTTP_MAX_LENGTH;

        int streamId = RANDOM.nextInt() & 0x7FFFFFFF | 0x01;
        int promisedStreamId = RANDOM.nextInt() & 0x7FFFFFFF | 0x01;
        ByteBuf headerBlock = Unpooled.buffer(2 * HTTP_MAX_LENGTH);
        for (int i = 0; i < 2 * HTTP_MAX_LENGTH; i++) {
            headerBlock.writeByte(RANDOM.nextInt());
        }
        ByteBuf frame = releaseLater(
                ENCODER.encodePushPromiseFrame(streamId, promisedStreamId, headerBlock.duplicate())
        );
        assertPushPromiseFrame(frame, streamId, promisedStreamId, headerBlock);
    }

    @Test
    public void testHttpPingFrame() throws Exception {
        long data = RANDOM.nextLong();
        ByteBuf frame = releaseLater(
                ENCODER.encodePingFrame(data, false)
        );
        assertPingFrame(frame, false, data);
    }

    @Test
    public void testHttpPongFrame() throws Exception {
        long data = RANDOM.nextLong();
        ByteBuf frame = releaseLater(
                ENCODER.encodePingFrame(data, true)
        );
        assertPingFrame(frame, true, data);
    }

    @Test