Al-Anbya 21:78
And [mention] David and Solomon, when they judged concerning the field - when the sheep of a people overran it [at night],[896] and We were witness to their judgement.
Ayah 78
وَدَاوُۥدَ وَسُلَيْمَٰنَ إِذْ يَحْكُمَانِ فِى ٱلْحَرْثِ إِذْ نَفَشَتْ فِيهِ غَنَمُ ٱلْقَوْمِ وَكُنَّا لِحُكْمِهِمْ شَٰهِدِينَ
And [mention] David and Solomon, when they judged concerning the field - when the sheep of a people overran it [at night],[896] and We were witness to their judgement.