And Joseph's brothers went down....It is not written as "the sons of Jacob," in order to teach us that they were contrite about their having sold him, and they undertook to conduct themselves towards him as brothers....
...
Etz Chayim Commentary:
The purpose of Joseph's elaborate ruse is not to torment or embarrass his brothers, but to see whether they indeed had changed. Repentance (t'shuvah) is more than regret. It includes finding oneself in a similar situation and responding differently. Joseph needs to know whether the brothers will leave Simeon and/or Benjamin to languish in prison, as they once abandoned him.
AND JOSEPH SAW HIS BROTHERS, AND HE KNEW THEM, BUT MADE HIMSELF STRANGE TO THEM: Rabbi Joshua b. R. Nechemiah said: He made himself a stranger to them.
AND JOSEPH KNEW HIS BROTHERS: When they fell into his hand: BUT THEY DID NOT KNOW HIM: When he fell into their hands. The Rabbis said: He had left them bearded, therefore, AND JOSEPH KNEW HIS BROTHERS; but they had left him beardless, consequently, BUT THEY DID NOT KNOW HIM.
WE ARE ALL ONE MAN'S SONS: The holy spirit was enkindled in them and they said to him [unwittingly]: You and we are the sons of the same man.