(Max|Min)PriorityQueue.from static method naively constructs the heap one element at a time which takes O(N log N) time (because each insertion is a log N operation.
There is a better way to set it up when the incoming values are known at heap initialization time that runs in O(N) time.