We bestowed the same favour upon David and Solomon . Recall , when they gave judgement regarding a tillage into which the sheep of some people had strayed at night , and We were witnesses to their judgement .