Italian researchers have conducted a study which shows that bonobos' reaction to the yawning of other members of their species is not invariably the same.
It has been noticed that a bonobo is by far more receptive to a friend's yawning than to that of a stranger, Science Daily
The phenomenon is not an unprecedented one, since the same reaction had been previously noticed by scientists among human beings.
Although it is obvious that the physiological responses of the body are conditioned by the humans or animals' emotional involvement in their relationships with the group, the mechanism through which this link functions remains unknown.
On a slightly amusing note, we could say yawning is a rudimentary form of empathy.
The best and worst side of it comes from our inability to control it. So how about we (and the bonobos) tell who our friends are by observing whether they yawn or not in response to our own yawning?