// The fake cast to E is safe because the creation methods only allow E's @SuppressWarnings("unchecked") @Override public UnmodifiableIterator<E> iterator() { return (UnmodifiableIterator<E>) Iterators.forArray(array, offset, size); }
@SuppressWarnings("unchecked") @Override public UnmodifiableListIterator<E> listIterator(int index) { return (UnmodifiableListIterator<E>) Iterators.forArray(array, offset, size, index); }
@SuppressWarnings("unchecked") @Override public UnmodifiableIterator<E> iterator() { return (UnmodifiableIterator<E>) Iterators.forArray(elements); }