title: Removing top of PriorityQueue?
body: <p>Assume that I am using the PriorityQueue class from Java.util. I want to remove the largest number from the PriorityQueue pq, which we assume is at the head of the queue.</p>
  
  <p>Will the following work?</p>
  
  <pre><code>// 1 
  int head = pq.peek();
  pq.dequeue(head);
  
  // 2
  int head = pq.dequeue(pq.peek());
  </code></pre>
  
  <p>Would this work the same for non-primitives as well?</p>