Object that passes only new messages?

Is there an object that will pass a message, and then reject any duplicates of that message until it receives a new message, which it would then pass, and then reject duplicates of the new message, and so on?