title: PriorityQueue with external parameters
body: <p>I have a project where I have a class Halfedge (olny .class file, so no way to modify it). 
  I want to create a PriorityQueue.
  In order to determine which element is bigger, I need not only the fields inside the Halfedge class, but also a HashMap that I create in my code.</p>
  
  <p>The thing is: when I define the Comparator class specific for the Halfedge, I cannot include any parameters.</p>
  
  <p>My question is: how can I implement a comparator class for my Halfedge class using outside parameters? (or simply, how shoul I construct that PriorityQueue)</p>
  
  <p>Thanks a lot!</p>