I don't see this as optional. This lifo assumes that there are no double entries in the queue, but until now it's not preventing this situation.

put 0 put 0 -> get 0 get 0 get 0 get 0 get 0 get  0 get 0 ... -> get 0 get 0 get -1

with that fix the lifo support double valued entries.