private QueueElement searchMax(){
        QueueElement current = head;
        QueueElement maxQueueElement = head;
        while (current != tail.next()) {
            if (current.getPriority() > maxQueueElement.getPriority()) {
                maxQueueElement = current;
            }
            current = current.next();
        }
        return maxQueueElement;
    }