code: private void heapify() {
          Object[] array = queue;
          int n = size;
          int half = (n >>> 1) - 1;
          Comparator<? super E> cmp = comparator;
          if (cmp == null) {
              for (int i = half; i >= 0; i--)
                  siftDownComparable(i, (E) array[i], array, n);
          }
          else {
              for (int i = half; i >= 0; i--)
                  siftDownUsingComparator(i, (E) array[i], array, n, cmp);
          }
      }
docs: Establishes the heap invariant (described above) in the entire tree,
  assuming nothing about the order of the elements prior to the call.