It can throw NoSuchElementException since only the lookup is protected by the try...catch. What is your point here, I am a bit confused I think.