title: Java PriorityQueue not polling expected object
body: <p>This is my first post here so feel free to point me in the right direction regarding formulating a question here.</p>
  
  <p>My issue is with the java.util.PriorityQueue.</p>
  
  <p>I have a queue that I initialize;</p>
  
  <pre><code>    myComparable comp = new myComparable();
  
      PriorityQueue&lt;someObject&gt; prioritized = new PriorityQueue&lt;someObject&gt;(11, comp);
  </code></pre>
  
  <p>I dont think it matters for the question what is in my queue or how myComparable is implemented. </p>
  
  <p>I then get unexpected output:</p>
  
  <pre><code>prioritizedObject = prioritized.poll();
  
  for(someObject otherObject : prioritized)
  {
      System.out.println(comp.compare(prioritizedObject, otherObject));
      System.out.println(comp.equals(prioritizedObject, otherObject));
  
  }
  </code></pre>
  
  <p>For one object in the list this prints:<br>
  1<br>
  false</p>
  
  <p>How can this be? How can I poll() an object from the queue while the comparator Im using says that another object in the queue is smaller?</p>