class DefaultPriorityQueue extends AbstractQueue<T> implements PriorityQueue<T> {

    @Override
    public T poll() {
        if (size == 0) {
            return null;
        }
        T result = queue[0];
        result.priorityQueueIndex(this, INDEX_NOT_IN_QUEUE);

        T last = queue[--size];
        queue[size] = null;
        if (size != 0) { // Make sure we don't add the last element back.
            bubbleDown(0, last);
        }

        return result;
    }

    @SuppressWarnings("unchecked") public  DefaultPriorityQueue(Comparator<T> comparator, int initialSize);

}