Compares value with expected and replaces it with new value if values matches. If new value is not null, it must be frozen or permanent object.
the old value
the expected value
the new value
if new is not frozen or a permanent object
Thanks for your feedback!