HeapSort implementation with Java