implemented proper equals and hashCode for replicas