Why did they name PriorityQueue if you can\'t insertWithPriority? It seems very similar to a heap. Are there any differences? If no difference, the
PriorityQueue
For max-heap you can use:
PriorityQueue queue = new PriorityQueue<>(10, Collections.reverseOrder());