Psalm 105:16–22

Then he called for a famine in the land and destroyed the supply of bread.

He sent a man before them, Joseph, who was sold as a slave.

They bruised his feet in fetters; his neck they put in an iron collar.

Until his prediction came to pass, the word of the Lord tested him.

The king sent and released him; the ruler of the peoples set him free.

He set him as a master over his household, as a ruler over all his possessions,

To instruct his princes according to his will  and to teach his elders wisdom.