Rewriting. Checks the validity of variant objects by comparing the held value with a given expected value.