Add equals and hashCode for EmptyReference.