code: private void upHeap(int idx) {
          Reference<E> e = entries.array[idx];
  
          int iter = idx;
          while (hasParent(iter)) {
              int pidx = parent(iter);
              Reference<E> p = entries.array[pidx];
              if (compare(e, p) < 0) {
                  entries.array[pidx] = e;
                  entries.array[iter] = p;
                  p.index = iter;
                  iter = parent(iter);
              } else {
                  break;
              }
          }
          e.index = iter;
      }
docs: Move an element upwards inside the heap, until it has a parent with a key less or equal to its own.