Compares value with expected and replaces it with new value if values matches. Note that comparison is identity-based, not value-based.
true if successful
the expected value
the new value
Thanks for your feedback!