Deletes those elements that represent doubled-up values. This condition is
detected in the handleElementAdded() method, but the actual deletion is
only performed after some kind of write was made to the document via a call
to
#add(Object),
#remove(Object) or
#clear().
Delaying document mutation ensures that agents and clients that are only
listening to a document do not send mutation operations, preventing issues
of writing to read-only wavelets and minimizing the number of concurrent
writers sending ops to a wave server.
When removing values from the container, obsolete elements ought to be
deleted before removing valid elements. This ensures that other
agents do not see an intermediate state where an obsolete element is
present, but a valid one is not.
When adding values to the container, obsolete elements ought to be deleted
after adding valid elements. This is to maintain symmetry with
removal, thereby pleasing all right-thinking engineers.