Whether crustaceans feel pain is generally something people try not to think about while munching on a crab cake or a lobster roll. Few of us would like to think that our dinner suffered during preparation, but still, we can't help but be a little curious.

Animal behavior professor Robert Elwood of Queen's University in Belfast, U.K., starting thinking about this crustacean sensation after he met Rick Stein, a well-known English chef and restaurateur known for his fish-forward fare. Stein asked Elwood if crabs felt pain. "I thought it was a very strange question," Elwood says. And he didn't have an answer.

That's because determining whether a creature feels pain can be difficult. "One might assume with higher mammals that it's very similar to humans," says Elwood. But other, simpler animals, like crabs, are more of a puzzle.

That's because what looks like pain could just be a phenomenon called nociception, which is when a body reacts automatically to stimuli that has the potential to damage tissue. "It's quite possible that animals have the ability to act simply by reflex," Elwood says, similar to the way you might pull your hand away from a hot plate without being aware that it's hot.

Actual pain, though, requires learning, Elwood says, because its purpose it to help a creature avoid future painful and damaging experiences.

And so scientists have come up with a list of criteria for what pain might look like in an invertebrate: whether the animal rubs itself, if it gives up essential resources to avoid the potentially painful experience, and if can learn to avoid them in the future. "If it does that, it's clearly making decisions," Elwood says. The animal, probably, feels pain.

A few years back, Elwood found that prawns would begin grooming and rubbing themselves when they had acetic acid dabbed onto their tentacles. And hermit crabs that are shocked out of their shells likewise show stress-related behavior after the incident, such as grooming their abdomens.

And in a study published this week in the Journal of Experimental Biology, Elwood reports that crustaceans exhibit the learning component of pain.

For the experiment, Elwood and student Barry Magee got a bunch of common British shore crabs. They took a crab and placed it in a tank that had two dark shelters (crabs love the dark), one of which was wired to give its occupant a mild electric shock. The crab picked a shelter, got its shock or not, and then was removed from the tank.

A short while later, the researchers put the crab back into the tank and let it choose again. By the time that crab had been shocked twice, it had learned to avoid the wired hideaway and pick the safer one.

"To our surprise, the data are consistent with pain," Elwood says.

If Elwood were to respond to Stein today, he'd say that crabs do feel pain. Probably. Elwood hasn't yet looked at stress hormones in crabs to see if they change in response to the electrical shock or other potentially painful experience — another key sign that actual pain is occurring. And if there's no difference in the hormones, "it would speak against pain," he says.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.