public IList<E> extract(int index, int len) {
        checkRange(index, len);

        IList<E> list = doCreate(len);
        for (int i=0; i<len; i++) {
            list.add(doGet(index+i));
        }
        remove(index, len);
        return list;
    }
Removes specified range of elements from list and return them.

@param index index of first element to retrieve
@param len   number of elements to retrieve
@return      list containing the specified range of elements
jphp-runtime/src/php/runtime/memory/support/IList.java