Added equals and hash to support unit test.