public int evictOnce() {
        int indexToEvict = -1;
        if (this.sortedRangeIndexList.isEmpty()) {
            return 0;
        } else if (this.sortedRangeIndexList.size() == 1) {
            // evict the only element
            indexToEvict = 0;
        } else if (this.sortedRangeIndexList.size() <= (1 + compactNum)) {
            indexToEvict = 1;
        }

        if (indexToEvict == -1) {
            if (evictIndex % this.sortedRangeIndexList.size() == 0
                || this.evictIndex >= this.sortedRangeIndexList.size() - compactNum) {
                this.evictIndex = 1;
            }
            indexToEvict = evictIndex++;
        }
        this.sortedRangeIndexList.remove(indexToEvict);
        size -= RangeIndex.OBJECT_SIZE;
        return RangeIndex.OBJECT_SIZE;
    }
Try to evict one range index from the list, the eviction priority for each element is:
1. any element that's not the first and last N compacted elements
2. the last N compacted elements
3. the first element
<p>
For example for a list of [0, 1, 2, 3, 4, 5], compact number is 2, the eviction result will be:
<ul>
<li><code>1rst: [0, 2, 3, 4, 5]</code></li>
<li><code>2nd:  [0, 2, 4, 5]</code></li>
<li><code>3rd:  [0, 4, 5]</code></li>
<li><code>4th:  [0, 5]</code></li>
<li><code>5th:  [0]</code></li>
<li><code>6th:  []</code></li>
</ul>

@return evicted size
s3stream/src/main/java/com/automq/stream/s3/index/SparseRangeIndex.java