I'm assuming that If Sorting happens, the poll() method removes the last element in the PriorityQueue after sorting by natural order.
www.coderanch.com