text: public List<E> subList(int from, int to) {Object[] snapshot = elements;if (from < 0 || from > to || to > snapshot.length) {throw new IndexOutOfBoundsException("from=" + from + ", to=" + to +", list size=" + snapshot.length);}return new CowSubList(snapshot, from, to);}