Add equality test example
Added the option to validate state