public void resize(int len, E elem) {
	    checkLength(len);

	    int size = size();
        if (len < size) {
            remove(len, size-len);
        } else {
            for (int i=size; i<len; i++) {
                add(elem);
            }
        }
        assert(size() == len);
	}
Resizes the list so it will afterwards have a size of
<code>len</code>. If the list must grow, the specified
element <code>elem</code> will be used for filling.

@param len  	length of list
@param elem 	element which will be used for extending the list
@throws 	 	IndexOutOfBoundsException if the range is invalid
jphp-runtime/src/php/runtime/memory/support/IList.java