In fact, Joseph was in Egypt because of two of his own dreams that made his brothers envy and despise him. As Nachmanides writes:
"Joseph had had two dreams -- one in which his eleven brothers' sheaves bowed to his, and a second dream in which the sun, moon and eleven stars bowed to him. He knew that they were both ordained to be fulfilled exactly as foretold, and in the order in which the dreams appeared to him.
This explains why Joseph acted as he did. For one might wonder: since Joseph was already established in Egypt for many years, and was a high official and a minister there, why did he not send a single letter to his father to notify him and comfort him? Hebron is just a six-days' journey from Egypt! Certainly his father would have ransomed him for any sum of money. But the dreams dictated that they would bow to him--something which Joseph understood would take place in Egypt, the place where he was gaining sovereignty and power. The dreams also dictated that, at first, only his brothers will bow to him, and that only on a second occasion will his entire family, including his father and (adoptive mother) Bilhah, do so. Had Joseph notified his father, Jacob would certainly have immediately come to him--contrary to how things were ordained in his dreams.
So Joseph waited for his brothers to come to Egypt to purchase food. But when they came and bowed to him there were only ten of them, so he knew that the first dream had not yet been fulfilled. He therefore had to devise a ploy that would compel them to bring Benjamin--without revealing his identity. Only after Benjamin had come and bowed together with his other brothers could Joseph notify his father and cause the second dream to be fulfilled as well.
Also the other ploy he devised--by planting the goblet in Benjamin's sack--was not to cause them suffering, but to be certain that his brothers did not harbor any jealousy toward Benjamin because of their father's preference of him, as they had towards himself. He therefore had to test their love and devotion towards Benjamin before he could allow him to go with them."
The following excerpt from The Cosmic Fantasy based on the teachings of the Lubavitcher Rebbe described the dreamworld we live in:
"Rabbi Schneur Zalman of Liadi explains that galut was born out of a succession of dreams because galut is the ultimate dream. A dream is perception without the discipline of reason. Here are all the stimuli and experiences we know from real life: sights and sounds, thoughts and action, exhilaration and dread. Indeed, everything in a dream is borrowed from our waking lives. But everything is topsy-turvy, defying all norms of logic and credulity. In a dream, a tragedy might be a cause for celebration, a parent might be younger than his child, a cow may jump over the moon.
Galut is a dream: a terrible, irrational fantasy embracing the globe and spanning millennia. A dream in which crime pays, the good die young, and G-d's chosen people are slaughtered with impunity. A dream in which what is right and true is seldom "realistic," and nonentities such as "ignorance," "death" and "evil" are potent forces in our lives.
The surreality of galut pervades our spiritual lives as well. Only in galut can a person arise in the morning, purify himself in a mikvah, pray with ecstasy and devotion, study a chapter of Torah, and then proceed to the office for a business day of connivance and deceit. "Hypocrisy" is not an adequate description of this phenomenon--in many cases, his prayer is sincere, and his love and awe of G-d quite real. But he inhabits the dream-world of galut, where antitheses coexist and inconsistencies are the norm."