Overloaded toMaxHeap in MaxHeapBuilder.