Testicle lumps may be caused by cysts, hydroceles, and epididymitis. A cyst is a fluid-filled sac that can feel like a small, hard lump when touched. Cysts can develop almost anywhere on the body and are usually harmless. A varicocele is a lumpy area caused by swollen veins in the testicles.
It could be an infected or irritated hair follicle from shaving, or a wart or a variety of other things. There is no way for us to know. Only a doctor who actually examines you will be able to tell you what it is.
Leave the area alone for a few days, and see if it heals. If it's irritation from shaving, it shouldn't take longer than that to get better. If it lingers longer than that, or gets red or painful, see your doctor.