public void moveDown(int index) {
        int currentIndex = 0;
        int leftIndex = leftChild(index);
        int rightIndex = rightChild(index);
        if (rightIndex >= heapSize || leftIndex >= heapSize) {
            return;
        }

        currentIndex = array[leftIndex] <= array[rightIndex] ? leftIndex
                : rightIndex;

        if (array[index] > array[currentIndex]) {
            array = swap(array, currentIndex, index);
            moveDown(currentIndex);
        }
    }