title: Java iterate through priority queue
body: <p>I'm trying to do a while loop that will iterate through a java priority queue and read in top of the queue's date. One it has the date value, looks through the rest of the queue to see if this date is being used elsewhere, if so add these elements temporarily to their own queue so I can call a different comparator method to sort them out.</p>
  
  <pre><code>public JobRequest closestDeadlineJob(int freeCPUS) {
      // find top job to determine if other jobs for date need to be considered
      JobRequest nextJob = scheduledJobs.peek(); // return top most job
      // what is it's date?
      Date currentDate = nextJob.getConvertedDeadlineDate();
      JobPriorityQueue schedulerPriorityQueue = new JobPriorityQueue();
      schedulerPriorityQueue.addJob( nextJob );
  
      while(true) {
  
  
      }
  
      // this is the item at the top of the PRIORTY JOB queue to return 
      // remove that item from scheduledJobs
     // return null; // replace with to the one you want to return
  }
  </code></pre>
  
  <p>what I have so far, as you can see not very much</p>