Add equals and hashCode for testing purposes.