Even treats can't distract pets from having your back. In a study due to be published later this month, Japanese researchers recently found that dogs will refuse treats from people who are rude to their owners. This could indicate that dogs disregard personal benefit when judging unfair situations, Agence France Presse reported.

The team of scientists tested three sets of 18 dogs between 7 months and 14 years old, Nikkei reported. In each scenario, the dog's owner approached them accompanied by two strangers. The owner began struggling to open a box and asked the others for help. In one group, one of the strangers snubbed the owner, and in another the stranger agreed to help. In all scenes, the third person did nothing. They repeated the scene four times.

Afterward, the two strangers offered the dogs food. The animals were more likely to accept treats from the neutral person than the person who had rejected their owners' request for assistance. The dogs with owners who got help from the strangers didn't show a significant preference.

“The animal apparently learns complex information from humans’ behavior in deciding its own actions,” lead author and Kyoto University cognitive science professor Kazuo Fujita told the Asahi Shimbun.

Fujita said the study shows that dogs form opinions about people based on their attitudes toward their masters. "We discovered for the first time that dogs make social and emotional evaluations of people regardless of their direct interest," he told AFP. "This ability is one of key factors in building a highly collaborative society, and this study shows that dogs share that ability with humans."

Capuchin monkeys have the quality, as well, but chimpanzees do not. The researchers planned next to expand the experiment to cats and squirrel monkeys, Jiji Press reported.

The journal Animal Behavior will publish the study soon. Watch the test scenes play out here.