HeapSort Java implementation