public static <E> E pollLast(List<E> list) {
        return list.remove(list.size() - 1);
    }
Remove the last element from list and return it.
jraft-core/src/main/java/com/alipay/sofa/jraft/util/ArrayDeque.java