code: @SuppressWarnings("unchecked")
    public E replaceTopElement(E e) {
      E oldroot = (E) queue[0];
      heapifyDown(0, e);
      heapModified();
      return oldroot;
    }
docs: Combined operation that removes the top element, and inserts a new element
  instead.
  
  @param e New element to insert
  @return Previous top element of the heap