in concurrency-loadbalancer-core/src/main/java/com/uber/concurrency/loadbalancer/utils/HashIndexedPriorityQueue.java [102:114]
public boolean offer(E e) {
int index = indexOf(e);
if (index != -1) {
siftUp(index, e); // sift up if smaller than parent
siftDown(index, e); // sift down if bigger than child
} else {
index = entityList.size();
entityList.add(e);
entityToIndex.put(e, index);
siftUp(index, e);
}
return true;
}