Another interpretation: Just as Jacob was hidden from his father for twenty-two years, so Joseph was hidden from his father for twenty-two years. Therefore it is said, "These are the generations of Jacob: Joseph." Rabbi Levi said in the name of Rabbi Yochanan: Wherever it says "he was," that one saw three worlds. Of Noah it is written, "Noah was perfect" (Genesis 6:9): he saw the world in its settled state before the Flood came, and he saw it laid waste, and he saw it afterward in its restoration; therefore it is said of him "he was." Of Moses it is written, "he was tending the flock" (Exodus 3:1): he saw Israel before the bondage grew strong, and he saw the bondage, and they saw them when they were redeemed. [Of Mordecai it is written,] "There was a Jewish man in Shushan the capital" (Esther 2:5): he saw them before they were enslaved at the hand of Haman, and he saw them under the decrees that were decreed against them, and he saw them in their redemption. Of Job it is written, "There was a man in the land [of Uz]" (Job 1:1), and he saw three worlds: he was whole, and he was afflicted with sufferings, and afterward he was healed. And of Joseph too "he was" is written: "These are the generations of Jacob: Joseph, being seventeen years old, was tending [the flock]" (Genesis 37:2).
Joseph and the Five Who Saw Three Worlds in Scripture
Midrash Tanchuma Buber, Vayeshev 5:2
ד"א מה יעקב נתכסה מאביו כ"ב שנה, כך יוסף נתכסה מאביו כ"ב שנה, לכך נאמר אלה תולדות יעקב יוסף. אמר ר' לוי אמר ר' יוחנן כל מקום אשר הוא אומר היה, ראה ג' עולמות, כתיב בנח תמים היה (שם ו ט), ראה את העולם בישובו עד שלא בא המבול, וראה אותו חרב, וראה אותו בתיקונו אחר כך, לכך נאמר בו היה. משה כתיב היה רועה וגו' (שמות ג א), ראה ישראל עד שלא נתחזק השעבוד, וראה השעבוד, וראו אותן כשנגאלו. [במרדכי כתיב] איש יהודי היה בשושן הבירה (אסתר ב ה), ראה אותן עד שלא נשתעבדו ביד המן, וראה אותם בגזירות שנגזרו עליהם, וראה אותם בגאולתם. איוב כתיב איש היה בארץ (איוב א א), וראה ג' עולמות, היה תם, ונתייסר ביסורין, ואח"כ נתרפא, ואף יוסף כתיב בו היה, אלה תודלות יעקב יוסף בן שבע עשרה שנה היה רועה (בראשית לז ב).