code: private static <T> void siftUpComparable(int k, T x, Object[] array) {
          Comparable<? super T> key = (Comparable<? super T>) x;
          while (k > 0) {
              int parent = (k - 1) >>> 1;
              Object e = array[parent];
              if (key.compareTo((T) e) >= 0)
                  break;
              array[k] = e;
              k = parent;
          }
          array[k] = key;
      }
docs: Inserts item x at position k, maintaining heap invariant by
  promoting x up the tree until it is greater than or equal to
  its parent, or is the root.
  
  To simplify and speed up coercions and comparisons. the
  Comparable and Comparator versions are separated into different
  methods that are otherwise identical. (Similarly for siftDown.)
  These methods are static, with heap state as arguments, to
  simplify use in light of possible comparator exceptions.
  
  @param k the position to fill
  @param x the item to insert
  @param array the heap array