Hello,
Gynecomastia is one of the presenting features in testicular cancer but is not the sole symptom of testicular cancer. Testicular pain can also be due to injury, infection (Epididymitis or Orchitis) or inflammation, testicular torsion( most common in young men), excessive bicycle riding, hernia,varicocele or kidney or ureteric stones.
Lab investigations like complete blood examination, urine examination, ultrasound lower abdomen and sometimes a urethral swab will help in diagnosis. Treatment will be started thereafter.My advise would be to consult a urologist.
It is very difficult to precisely confirm a diagnosis without examination and investigations and the answer is based on the medical information provided. For exact diagnosis, you are requested to consult your doctor. I sincerely hope that helps. Take care and please do keep me posted on how you are doing.