Psalm 105:16-25 ESV
When he summoned a famine on the land
and broke all supply of bread,
he had sent a man ahead of them,
Joseph, who was sold as a slave.
His feet were hurt with fetters;
his neck was put in a collar of iron;
until what he had said 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 made him lord of his house
and ruler of all his possessions,
to bind his princes at his pleasure
and to teach his elders wisdom.
Then Israel came to Egypt;
Jacob sojourned in the land of Ham.
And the LORD made his people very fruitful
and made them stronger than their foes.
He turned their hearts to hate his people,
to deal craftily with his servants.
ESV: English Standard Version 2016