@Override
    public String toString() {
        return "SegmentList [segments=" + this.segments + ", size=" + this.size + ", firstOffset=" + this.firstOffset
               + "]";
    }
Removes from this list all of the elements whose index is between
0, inclusive, and {@code toIndex}, exclusive.
Shifts any succeeding elements to the left (reduces their index).
jraft-core/src/main/java/com/alipay/sofa/jraft/util/SegmentList.java