I remember hearing form Rabbi Mordechai Gifter many years ago that he enjoys reading the seforim of two baalei batim (businessmen) who were never rabbis. One was the Rashash, who was a successful businessman in the late 1800's and a president of the Vilna kehillah, and the other was Reb Moshe Leib Shachor (Rabbi Zevulun Charlop's great grandfather) who wrote the sefer Avnei Shoham on the Chumash.
In Parshas Vayigash the sefer Avnei Shoham has a very interesting comment. We know that Yosef haTzaddik was testing his brothers to see if they had done teshuvah for reacting so harshly and with such jealousy towards him because he was Yaakov's favorite son. The Torah describes the tragedy that resulted from Yaakov Avinu favoring Yosef in order to teach us not to show favoritism to one child over others. But Yosef haTzaddik knew that his father probably continued to have this approach in raising children and Binyomin would be the favorite son now that he (i.e. Yosef) was absent. Yosef wanted to test his brothers before he was going to be mochel them to see if they did teshuva. Through his tests Yosef saw that they were in fact prepared to protect their father by protecting Binyomin, even though Binyomin was the favorite son. Later on Yosef did forgive them, and said that just as he had no grudge against Binyomin similarly he had no grudge against any of his brothers. He realized that everything was min Hashomayim.
Although we understand why Yosef was acting the way he was towards the brothers, for them it was such a puzzle; they couldn't understand the strange way Tzafnas Paneach was treating them until finally in Parshas Vayigash he says, "ani Yosef ha'od avi chai - I am Yosef! How did you sell me? Why weren't you afraid that our father is going to have a heart attack and die? It's good, however, that now you are afraid of the effect that losing Binyomin would have on our father." Yosef saw that his brothers were chozer beTeshuvah.
Because Yosef's brothers were missing one piece of information, i.e. that this man is Yosef, everything was puzzling and they couldn't understand what was going on. The same thing occurs in the history of the Jewish people; there are so many strange things in Jewish history that we don't understand. The haftorah for Parshas Vayigash tells us that le'asid lavo, when we will experience the geulah ha'asidah and look back in retrospect, everything will be able to be understood in context. Right now we don't have the whole picture and therefore we don't understand many things in our history.
In Parshas Bereishis the Torah says regarding almost every day of creation, "Vayar Elokim ki tov", but on the sixth day the Torah says, "Vayar Elokim et kol asher assah vehnei tov meod." The Medrash says "'Tov' zeh ha'chayim, 'tov meod' zeh ha'maves", i.e. that even when someone dies it's "tov meod." This is difficult for us to understand; we experience death as a tragedy and we recite a bracha, "baruch Dayan Ha'emmes!"
When you look at everything in proper perspective, "Vayar Elokim es kol asher assah", if you look at everything all put together and you're not missing any point of information, everything is in fact tov meod. We don't see all of history at once. How long does a person live, a hundred years? We may study history, but we don't really fully understand it from the beginning to the end. When all of history will be unfolded and we will look back in retrospect and understand all of the puzzling things that never made any sense. Why was there was "tzaddik ve'ra lo, rasha ve'tov lo"? Why did the Jewish people suffer so much? We'll look back in retrospect and understand that everything was really le'tovah. That's the connection between Parshas Vayigash and its haftorah. In Vayigash the brothers were missing an important piece of information (that the man that they were talking to was Yosef) and that's why they couldn't understand what was happening. Once they were told that he was it all made sense. Similarly, in the haftorah we are told that leasid lavo, after all of Jewish history will be unfolded before us, everything will be understood in context.