You wouldn't necessarily care about genetic diversity for this sort of experiment. This experiment isn't trying to say "all animals" or "all rat species" exhibit this behavior; the interesting thing is that any animal does.
For me, the more important question is not whether all test subjects were genetically diverse: it's more important that the free rat and the caged rat are dissimilar. The situation would be vastly different if the rat pairs were related, since there is a genetically selfish motivation for caring for those within the same gene pool.