code: protected void fixupWithComparator(int k) {
          if (onMinLevel(k)) {
              int p = k / 2;
              K kValue = array[k];
              if (p > 0 && comparator.compare(array[p], kValue) < 0) {
                  array[k] = array[p];
                  array[p] = kValue;
                  fixupMaxWithComparator(p);
              } else {
                  fixupMinWithComparator(k);
              }
          } else {
              int p = k / 2;
              K kValue = array[k];
              if (p > 0 && comparator.compare(kValue, array[p]) < 0) {
                  array[k] = array[p];
                  array[p] = kValue;
                  fixupMinWithComparator(p);
              } else {
                  fixupMaxWithComparator(k);
              }
          }
      }
docs: Upwards fix starting from a particular element
  
  @param k
  the index of the starting element