code: private void removeLast(HeapEntry<E> entry) {
      indexToEntry.remove(entry.index);
      objectToEntry.remove(entry.object);
    }
docs: Remove the last element of the heap (last in the index array).
  Do not call this on other entries; the last entry is only passed
  in for efficiency.
  
  @param entry the last entry in the array