R’ Asher Kalman Baron zt”l (Alei Veradim) would say: “ולא יכול יוסף להתאפק' - Yosef constantly scrutinized his behavior as to what degree he was permitted to act toward his brothers with what appeared to be the trait of vengeance. He acted like a stranger for he knew that this was necessary and he was doing so for Heaven’s sake. But when he felt that he had reached the limit of what they deserved, from this point on it would already be forbidden for him to behave in this way. Therefore, he could suddenly no longer restrain himself.”
A Wise Man would say: “My best friend is the one who brings out the best in me.”