The Jataka, Vol. II, tr. by W.H.D. Rouse, , at sacred-texts.com
"Birds of a feather," etc.--This story the Master told whilst at Jetavana, about two hot-tempered Brothers.
It happened that there were two Brothers, passionate, cruel, and violent, one living at Jetavana and one in the country. Once the country Brother came to Jetavana on some errand or other. The novices and young Brothers knew the passionate nature of this man, so they led him to the cell of the other, all agog to see them quarrel. No sooner did they spy one another, those two hot-tempered men, than they ran into each other's arms, stroking and caressing hands, and feet, and back!
The Brothers talked about it in the Hall of Truth. "Friend, these passionate Brothers are cross, cruel, angry to every body else, but with each other they are the best of friends, cordial and sympathetic!" The Master came in, asking what they sat there talking about? They told him. Said he, "This, Brothers, is not the only time that these men, who are cross, cruel, and angry to all else, have shown themselves cordial, and friendly, and sympathetic to each other. It happened just so in olden days"; and so saying, he told an old-world tale.
Once upon a time when Brahmadatta was king of Benares, the Bodhisatta was his do-all, a courtier who advised him on things temporal and things spiritual. Now this king was of a somewhat covetous nature;  and he had a brute of a horse, named Mahāsoṇa, or Big Chestnut.
Some horse-dealers from the north country brought down five hundred horses; and word was sent to the king that these horses had arrived. Now heretofore the Bodhisatta had always asked the dealers to fix their own price, and then paid it in full. But now the king, being displeased with him, summoned another of his court, to whom he said,
"Friend, make the men name their price; then let loose Big Chestnut so that he goes amongst them; make him bite them, and when they are weak and wounded get the men to reduce their price."
"Certainly," said the man; and so he did.
The dealers in great dudgeon told the Bodhisatta what this horse had done.
"Have you not such another brute in your own city?" asked the Bodhisatta. Yes, they said, there was one named Suhanu, Strongjaw, and a fierce and savage brute he was. "Bring him with you the next time you come," the Bodhisatta said; and this they promised to do.
So the next time they came this brute came with them. The king, on hearing how the horse-dealers had arrived, opened his window to look at the horses, and caused Chestnut to be let loose. Then as the dealers saw Chestnut coming, they let Strongjaw loose. No sooner had the two met, than they stood still licking each other all over!
The king asked the Bodhisatta how it was. "Friend," said he, "when these two rogue horses come across others, they are fierce, wild, and savage, they bite them, and make them ill. But with each other--there they stand, licking one another all over the body! What's the reason of this?" "The reason is," said the Bodhisatta, "that they are not dissimilar, but like in nature and character." And he repeated this couple of verses:
 "Both savage are, and vicious both; both always bite their tether;
So sin with sin, and vice with vice, must e’en agree together."
Then the Bodhisatta went on to warn the king against excessive covetise, and the spoiling of other men's goods; and fixing the value, he made him pay the proper price. The dealers received the due value, and went away well satisfied; and the king, abiding by the Bodhisatta's admonition, at last passed away to fare according to his deeds.
When the Master had ended this discourse, he identified the Birth: "The bad Brothers were then these two horses, Ānanda was the king, and I was the wise counsellor."