ISPN-4626 Race condition in the LocalEntryRetriever between iterator() and hasNext()
ISPN-4626 Avoid looking on hasNext unless necessary