I guess you can use selectedReplicas.size here (but it's old code anyways, so I don't have any problems if you don't change it)