title: Java PriorityQueue Comparator - How/When do you sort?
body: <p>I'm initialising a Priority Queue like:</p>
  
  <pre><code>strategy = new FuelPriority();
  incoming = new PriorityQueue&lt;Vehicle&gt;(1, strategy);
  </code></pre>
  
  <p>The code for my Comparator class is: </p>
  
  <pre><code>public class FuelPriority implements Comparator&lt;Object&gt; {
  
  public int compare(Object o1, Object o2) {
  
      Vehicle a1 = (Vehicle) o1;
      Vehicle a2 = (Vheicle) o2;
  
      return Integer.compare(a1.getFuelLevel(), a2.getFuelLevel());
    }
  }
  </code></pre>
  
  <p>After running a simulation, the elements aren't ordered at all - they are random; I set a breakpoint in the compare method of my <code>FuelPriority</code> class, but it wasn't called at all.
  Am I missing something here?</p>