title: How to get inverse of a comparator in java
body: <p>In a method I receive a generic <code>object E extends Comparable&lt;E&gt;</code> as an argument. Now i want to create two priority queues.One which uses the <code>comparator</code> used by E and other queue which uses the opposite of <code>comparator</code> used by E(i.e. if E uses '&lt;' then second queue must use '>=').
  Please hep me how to create two such queues.</p>
  
  <pre><code>queue2=new PriorityQueue&lt;E&gt;(0,Collections.reverseOrder(e));
  </code></pre>
  
  <p>I am getting the error that <code>reverseOrder</code> is not applicable.</p>
  
  <p>please help</p>