How do you tell a good nut from a yukky one?

This is a test to seperate true dopers from posers. True dopers will immediately say “Aha! mangeorge has been inspired by an old thread to ask this question.” And you’d be right, of course.
So how does someone determine if a nut is edible without opening and maybe sampling it? I reallylike nuts in the shell. All them beauties. But I occasiunally get burned and come home with some nasties. Usually thet’re slightly rancid. That’s not yummy. Sampling in the store is ok, but limited.
Any ideas?
mangeorge, the nutcracker.