It is taught in a baraita: Rabbi Yosei says: Three mitzvot were commanded to the Jewish people upon their entrance into Eretz Yisrael: To establish a king for themselves, and to cut off the seed of Amalek in war, and to build for themselves the Chosen House in Jerusalem. And so the verse states concerning David: “And it came to pass, when King David dwelled in his house and the Lord had given him rest round about from all his enemies” (II Samuel 7:1). And it is written immediately afterward: “That the king said to Nathan the prophet: See now, I dwell in a house of cedar but the Ark of God dwells within curtains” (II Samuel 7:2), and King David then began seeking a site to build the Temple.
Rabbi Yoḥanan says: Any place in the Bible from where the heretics attempt to prove their heresy, i.e., that there is more than one god, the response to their claim is alongside them,. The verse states: “And who is like Your people, like Israel, a nation one in the earth, whom God went to redeem unto Himself for a people?” (II Samuel 7:23), where the term “went” is written in plural, halekhu, but the term “Himself” is written in singular.
A certain heretic said to Rabbi Avina: It is written: “And who is like Your people, Israel, one nation in the earth” (II Samuel 7:23). The heretic asked: What is your greatness? You are also mixed together with us, as it is written: “All nations before Him are as nothing; they are counted by Him less than nothing and vanity” (Isaiah 40:17). Rabbi Avina said to him: One of yours, the gentile prophet Balaam, has already testified for us, as it is written:“It is a people that shall dwell alone, and shall not be reckoned among the nations” (Numbers 23:9), teaching that where the verse mentions “the nations,” the Jewish people are not included.