Removing elements with the same priority from a PriorityQueue
<p>While executing this code:</p>

<pre><code>Queue q=new PriorityQueue();
q.add(1);
q.add(1);
q.add(1);
q.add(2);
System.out.println(q);
System.out.println(q.remove(1));
System.out.println(q);
</code></pre>

<p>The output is:</p>

<pre><code>[1, 1, 1, 2]
true
[1, 2, 1]
</code></pre>

<p>Could someone please explain the reason for this shifting in the value of 1 in the output?</p>
