BackingMaps can act as FIFO (first-in, first-out) queues thanks to the
getNextKey(int timeout) method. This method retrieves the next key in the map determined by its insertion order. When this method is called, a lock on the object is obtained so that next call to
getNextKey(int timeout) does not return the same object. In order to iterate over an entire BackingMap, the application must explicitly remove the object with that key when the thread or process is finished with it. Otherwise, the key remains at the front of the queue and the next call to
getNextKey(int timeout) returns a key that we have already operated upon. Without removing the key, a call to
getNextKey(int timeout) will return the same key whenever the lock on that ...