In my honest opinion this is the simplest way to assure, that you're still handling events for this WatchKey/Path mapping.
In case there are two events for the same file in the queue. While handling event #1 you decide to stop handling events for this Path.
After that you retrieve the next key from the WatchService (same Path as event #1), you are immediately able to ignore it (continue
).