good nuts from bad nuts..how to tell in the shell?

I’ve got a friend who collects wild nuts like walnuts. He often spends a lot of time cleaning the nut, breaking the shells open and finding they are bad…moldy, rotten, empty. He’s floated them in water to separate the good from the bad (the good sink), but finds a large percentage of the ‘good nuts’ float with the bad ones. He’s not opposed to spending some cash on technology that can more accurately determine good from bad. We’ve thought of X-ray, Near Infrared, or maybe ultrasound. I think there are some ‘sonic’ analysis instruments out there that might work.
I’m looking for ideas on how to quickly and accurately separate good from bad.

I don’t have any answer, but I have a related anecdote that I’ll tell here solely for any entertainment value the reader may derive:

I lived in a guest house on a ranch in the country, with a landlord who had horses, cows, dogs, and eleven macaws. Mr. and Mrs. Landlord traveled often, leaving me to feed all those critters (for which, I got my rent reduced). I often had to cook elaborate gourmet cuisine for those damn birds!

Mr. Landlord-man got several full-size barrels of reject walnuts directly from some local grower, that couldn’t be sold commercially because of minor external blemishes. My job was to crack open five walnuts for each parrot, reject the buggy or moldy ones, and feed the good ones to the parrots. That’s FIFTY-FIVE walnuts for 11 birds. But only the good walnuts counted. I was supposed to toss out the bad ones, and keep cracking nuts until each bird got five good ones.

It took longer than we thought. The major problem was that I ate all the good ones myself. Only after I had had enough did those miserable macaws get any. Between the bad nuts, and the good ones that I ate, and the good ones that the parrots eventually got, I ended up cracking open probably 120 to 150 walnuts and got blisters on my hands!

Trained squirrels.