Yes and no. It depends on the implementation of the Iterable<T> interface.
Usually it should return a new instance of the class that implements the Iterable interface, the AbstractList class implements this as follows:
public Iterator<E> iterator() { return new Itr();
If you use standard Java classes, you can expect this to be done this way.
Otherwise, you can do a simple test by calling iterator() form an object, and then run first and after this second, if they depend, the second should not give any result. But this is unlikely.
source share