class CheckedIterator {

    public boolean copyInto(@NonNull Collection<? super E> collection) throws T {
        Objects.requireNonNull(collection);
        boolean wasModified = false;
        while (hasNext()) {
            wasModified |= collection.add(next());
        }
        return wasModified;
    }

}