Wherever you got that from has it backwards (it's a myth commonly repeated). The fruit name came first:
> In Molina's Nahuatl dictionary "auacatl" is given also as the translation for compañón "testicle", and this has been taken up in popular culture where a frequent claim is that testicle was the word's original meaning. This is not the case, as the original meaning can be reconstructed as "avocado" – rather the word seems to have been used in Nahuatl as a euphemism for "testicle".
Also "avocado" is an older variant of "abogado," which means lawyer in Spanish. English must have mixed these up.
And French completed this merge by having both "lawyer" and "avocado" translate to "avocat".
If I understand correctly, that's also where the Dutch "advocaat" liqueur comes from. They were trying to reproduce sweet avocado drinks, there were no avocados in Europe, so they made something up they thought tasted similar.
Obrigado, my good fellow.
Arigato, Mr. Roboto!