The answer is Transillumination
When the testicles descend into the scrotum in infants, the fluid in the scrotum is usually reabsorbed into the body within a year, and the channel for this fluid closes. However, when this reabsorption and closure of the opening fails, a hydrocele forms.
To diagnose a hydrocele, a physical examination by a physician is done by shining light through the scrotum to check for the presence of fluid.