private void bubbleDown() {
        int best = 0;
        for (;;) {
            final int oldBest = best;
            final int left = left(best);

            if (left < entriesSize) {
                final int right = right(best);
                if (isBetter(left, best)) {
                    if (right < entriesSize) {
                        if (isBetter(right, left)) {
                            // Left leaf is better but right leaf is even better.
                            best = right;
                        } else {
                            // Left leaf is better than the current entry and right left.
                            best = left;
                        }
                    } else {
                        // Left leaf is better and there's no right leaf.
                        best = left;
                    }
                } else if (right < entriesSize) {
                    if (isBetter(right, best)) {
                        // Left leaf is not better but right leaf is better.
                        best = right;
                    } else {
                        // Both left and right leaves are not better.
                        break;
                    }
                } else {
                    // Left leaf is not better and there's no right leaf.
                    break;
                }
            } else {
                // There are no leaves, because right leaf can't be present if left leaf isn't.
                break;
            }

            swap(best, oldBest);
        }
    }
A binary heap of Entry. Ordered by:
<ul>
  <li>{@link AbstractEventLoopEntry#activeRequests()} (lower is better)</li>
  <li>{@link AbstractEventLoopEntry#id()} (lower is better)</li>
</ul>
core/src/main/java/com/linecorp/armeria/client/HeapBasedEventLoopState.java