private Object[] coll2Array(final Collection<T> coll) {
        Object[] src;
        if (coll instanceof ArrayList && UnsafeUtil.hasUnsafe()) {
            src = LIST_ARRAY_GETTER.get((ArrayList<T>) coll);
        } else {
            src = coll.toArray();
        }
        return src;
    }
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