public URL nextElement() { if ( hasMoreElements() ) { // initialized by hasMoreElements() final String name = nextEntryName; nextEntryName = null; try { return findResource( name ); } catch ( final MalformedURLException e ) { // this shouldn't happen, hence illegal state throw new IllegalStateException( e.toString() ); } } throw new NoSuchElementException(); }