Code example for PriorityQueue

Methods: poll

0
  public boolean isQueueEmpty() { 
    return queue.isEmpty();  
  } 
 
  InstructionMessage retrieveInstructionMessageAtFrontOfQueue() { 
    return queue.poll(); 
  } 
}