@ Override public Iterator < T > iterator ( ) { writeLock . lock ( ) ; if ( iterator == null ) { iterator = new Iter ( ) ; } else { iterator . reset ( ) ; } return iterator ; }
Returned iterator is write - locked until hasNext returns false or unlock method is called .