hello and welcome..may i ask what pain on one side you were treated for?
your impotence can be caused by many things especially medication for depression, fatigue and stress.
there could also be a nueurological disorder?
your testicle pain could be a kidney stone trapped in the ureter and this could cause your erection problem as well.
we are not doctors but i would advise you seek medical help from a doctor for this problem. your still young and shouldn,t have this problem and worrying about it shall cause you problems also.
hope this helps you but watch your post here for reply,s.