// 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_CONNECTION_STREAM_ID = 0;


import java.util.Comparator;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.atomic.AtomicInteger;
import io.netty.channel.ChannelPromise;
import io.netty.util.internal.EmptyArrays;
import static com.twitter.http2.HttpCodecUtil.HTTP_DEFAULT_WEIGHT;
import static com.twitter.http2.HttpCodecUtil.HTTP_CONNECTION_STREAM_ID;
                }
            }
        }
        return e;
    }

    PendingWrite removePendingWrite(int streamId) {
        Node stream = streams.get(streamId);
        StreamState state = stream == null ? null : stream.state;
        return state != null ? state.removePendingWrite() : null;
    }

    /**
     * Set the priority of the stream.
     */
    boolean setPriority(int streamId, boolean exclusive, int dependency, int weight) {
        Node stream = streams.get(streamId);
        if (stream == null) {
            // stream closed?
            return false;
        }

        Node parent = streams.get(dependency);
        if (parent == null) {
            // garbage collected?
            stream.parent.removeDependent(stream);

            // set to default priority
            Node root = streams.get(HTTP_CONNECTION_STREAM_ID);
            root.addDependent(false, stream);
// 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_CONNECTION_STREAM_ID = 0;


// Path: src/main/java/com/twitter/http2/HttpConnection.java
import java.util.Comparator;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.atomic.AtomicInteger;
import io.netty.channel.ChannelPromise;
import io.netty.util.internal.EmptyArrays;
import static com.twitter.http2.HttpCodecUtil.HTTP_DEFAULT_WEIGHT;
import static com.twitter.http2.HttpCodecUtil.HTTP_CONNECTION_STREAM_ID;

                }
            }
        }
        return e;
    }

    PendingWrite removePendingWrite(int streamId) {
        Node stream = streams.get(streamId);
        StreamState state = stream == null ? null : stream.state;
        return state != null ? state.removePendingWrite() : null;
    }

    /**
     * Set the priority of the stream.
     */
    boolean setPriority(int streamId, boolean exclusive, int dependency, int weight) {
        Node stream = streams.get(streamId);
        if (stream == null) {
            // stream closed?
            return false;
        }

        Node parent = streams.get(dependency);
        if (parent == null) {
            // garbage collected?
            stream.parent.removeDependent(stream);

            // set to default priority
            Node root = streams.get(HTTP_CONNECTION_STREAM_ID);
            root.addDependent(false, stream);
            stream.setWeight(HTTP_DEFAULT_WEIGHT);