Guess what? When you need to obtain a semen sample from a pig for insemination or testing, that's how you do it. Yes, there are job descriptions in this world, particularly in the zoological and agricultural areas, that include "Pig Masturbator".
It could have been worse. At least it was only pigs and not elephants. Guess how you get a semen sample from an elephant? No, you can't give it a wank (there's a bit too much to wank, I guess). You have to instead massage the prostate through the rectum.