@Override
    public boolean addAll(int index, Collection<? extends E> c) {
        int numToAdd = c.size();
        if (underlying.size() > maxLength - numToAdd) {
            throw new BoundedListTooLongException("Cannot add another " + numToAdd +
                " element(s) to the list because it would exceed the maximum length of " +
                maxLength);
        }
        return underlying.addAll(index, c);
    }
A list which cannot grow beyond a certain length. If the maximum length would be exceeded by an
operation, the operation throws a BoundedListTooLongException exception rather than completing.
For simplicity, mutation through iterators or sublists is not allowed.

@param <E> the element type
server-common/src/main/java/org/apache/kafka/server/mutable/BoundedList.java