The pain is caused by tight back muscles. When tight the muscles can press onto the nerves, as they leave the spine, going to the organs. Pressure on the nerves going to your testicles will cause pain you will feel in your testicle. To get rid of that pain you have to free up your back muscles so they are released and here's how to free them up:
(do while sitting)
Place your left hand on your left leg next to your body. Place your right hand over your left shoulder, fingers over the back and the palm in the front and firmly pull down on them and hold. After 30 seconds slowly lower your body forward and to the outside of your left leg, keeping your left arm fairly straight as you do. When you reach your lap remain there for another 10 seconds, release the pressure but rest there for another 30 seconds. Then reverse your hand positions and do your right side.
For best results relax your body first by taking a deep breath and exhaling then remain this relaxed.