Asserts the value corresponds to the expected one using the given correspondence function to compare them. This is useful when the objects don't have an equals implementation.