In some circumstances, people, especially teenagers, are subjected to examinations for checking for recent or past sexual activity.
One example that comes to mind is the case of this couple (white man, black woman) in apartheid South Africa, whose underwear was seized (presumably for analysis for traces of recent activity), and the woman was submitted to a pelvic exam. I recall also some authoritarian regime having the wife of some political opponent undergo a pelvic to check for recent sexual activity, since it was rumored the opponent was in town.
In adult males, some countries where homosexuality is illegal do some checks on the anus and rectum, claiming to detect anal sex (there is a long history for that, see for instance the medical report on Paul Verlaine when he got into trouble with justice).
In teenagers, there have been cases of virginity checks (even in Western countries) for girls, and to checks for anal sex for males.
Now, I'm not into discussing if these checks are scientifically valid (the anal ones seem like hogwash, except if meant to detect recent traumatic activity).
I would like to know if some members here have been submitted to such tests, or know people who have, and in which circumstances.