"In the cave of Adullam the family were united in sympathy and affection. The son of Jesse could make melody with voice and harp as he sang, “Behold, how good and how pleasant it is for brethren to dwell together in unity!” Psalm 133:1 . He had tasted the bitterness of distrust on the part of his own brothers; and the harmony that had taken the place of discord brought joy to the exile's heart. It was here that David composed the fifty- seventh psalm. PP 658.1"
"Behold, how good and how pleasant it is for brethren to dwell together in unity!"
EGW directly quotes Psalm 133:1 and connects it to David's experience in the cave of Adullam.
"It was not long before David's company was joined by others who desired to escape the exactions of the king. There were many who had lost confidence in the ruler of Israel, for they could see that he was no longer guided by the Spirit of the Lord. “And everyone that was in distress, and everyone that was in debt, and everyone that was discontented,” resorted to David, “and he became a captain over them: and there were with him about four hundred men.” Here David had a little kingdom of his own, and in it order and discipline prevailed. But even in his retreat in the mountains he was far from feeling secure, for he received continual evidence that the king had not relinquished his murderous purpose. PP 658.2"
"And every one that was in distress, and every one that was in debt, and every one that was discontented, gathered themselves unto him; and he became a captain over them: and there were with him about four hundred men."
The EGW passage directly quotes 1 Samuel 22:2, describing the people who joined David's company.
"He found a refuge for his parents with the king of Moab, and then, at a warning of danger from a prophet of the Lord, he fled from his hiding place to the forest of Hareth. The experience through which David was passing was not unnecessary or fruitless. God was giving him a course of discipline to fit him to become a wise general as well as a just and merciful king. With his band of fugitives he was gaining a preparation to take up the work that Saul, because of his murderous passion and blind indiscretion, was becoming wholly unfitted to do. Men cannot depart from the counsel of God and still retain that calmness and wisdom which will enable them to act with justice and discretion. There is no insanity so dreadful, so hopeless, as that of following human wisdom, unguided by the wisdom of God. PP 658.3"
"And we know that all things work together for good to them that love God, to them who are the called according to his purpose."
The EGW passage suggests that David's difficult experiences were part of God's plan to prepare him for kingship. This aligns with the general principle expressed in Romans 8:28 that God works all things for the good of those who love Him. However, the connection is not a direct allusion but rather a thematic parallel.