David said, ‘He has done you wrong by demanding to add your ewe to his flock. Many partners treat each other unfairly. Those who sincerely believe and do good deeds do not do this, but these are very few.’ [Then] David realized that We had been testing him, so he asked his Lord for forgiveness, fell down on his knees, and repented:
(David) said: "He has undoubtedly wronged thee in demanding thy (single) ewe to be added to his (flock of) ewes: truly many are the partners (in business) who wrong each other: Not so do those who believe and work deeds of righteousness, and how few are they?"... and David gathered that We had tried him: he asked forgiveness of his Lord, fell down, bowing (in prostration), and turned (to Allah in repentance).