How are you? Lumps in groin can occur due to inguinal or femoral hernia, lipoma, sebaceous cyst, strangulated hernia, femoral aneurysm etc. In case of hernia's the lump may occur in an on and off fashion. A groin lump is localized swelling in the groin area. It may be firm or soft, tender or not painful at all.
Swelling of the testicle can occur due to varicocele, orchitis, hydrocele etc. As the swelling has accompanied by moderate pain and has appeared suddenly it could be infectious origin, like in orchitis.
Get an ultrasound scrotum done. Also it is important to get physical examination done by your doctor and take advise on hernia repair. In case hernia's left unrepaired can lead to intestinal obstruction, ischaemia, bleeding etc.
Take the opinion of your doctor.
All the best.