I have been married for 10 years. When my wife touches me before sex she has to be very careful. I saw a urologist who said I have epididymitis and the only thing to do is have my epididymis removed. You didn't mention any symptoms beyond pain in the testicles. The swollen area will feel hot and sausage-shaped to the touch.
Bacteria usually cause epididymitis.
The diagnosis is made when there is pain about the testicles that develops during several hours and is accompanied by fever. Usually only one testicle is affected. This condition is treated with antibiotics. If it is found to be bacterial in origin, it is also necessary to treat your sexual partner. Occasionally, chronic epididymitis develops and this may require surgery.