Rav Reichman spoke about the Shem MiShmuel's idea that Yehudah and Yosef represent two different personalities - the heart and the mind. And both use thier special personality to draw something out of the other. Yosef uses his mind and his self control to challenge Yehudah to show if he realy cares about his brothers. Yehudah uses his emotions to show Yosef that he is sincere in his pain over loosing Binyamin, and this causes Yosef to reveal himself.
I think it's interesting to look back on the path that gets both Yosef and Yehudah to become who they were. The Torah wants to show us the character development of Yosef and Yehudah, to show us that though they both ended up being amazing tzadikim and gedolim, they did not start out that way, and it was through working on themselves that they reached that point. Each one experienced a lot of suffering in their lives, but for each one it developed their character in different ways. Yehudah at first was cold and uncaring about others - especially Tamar. But the tragedy that he faces of loosing his wife and two sons, and Tamar's strategy, help him to recognize his self centeredness, and to become a more caring person. This is where Yehudah began to develop his emotional personality, to become "wise" in respect to his heart, and being concerned for others.
Yosef also started out without the ultimate traits of wisdom and self discipline that he ultimately develops. At first, he carelessly flaunts his dreams to his brothers, instead of following Ya'akov's lead of 'shamar et hadavar' - waiting and quietly seeing what would come of it. Yosef openly expresses himself before his brothers without self control. It is only through his experiences as a slave, and particularly the test of Eishet Potifar- which particularly centers on this aspect of public/private self discipline, that Yosef learns to control himself.
Hashem helps a person develop thier character by giving each person the tests and challenges that each person needs to become great. And once both Yosef and Yehudah become 'wise' in thier own way, they are able to use this wisdom to draw out wisdom in others, and to bring a terrible scene of confrontation to a happy ending of reconciliation.