God made reply: "I will let all the generations I have destroyed pass before thee, that thou mayest see they have not suffered the extreme punishment they deserved. But if thou thinkest that I did not act justly, then instruct thou Me in what I must do, and I will endeavor to act in accordance with thy words." And Abraham had to admit that God had not diminished in aught the justice due to every creature in this world or the other world. Nevertheless he continued to speak, and he said: "Wilt Thou consume the cities, if there be ten righteous men in each?" And God said, "No, if I find fifty righteous therein, I will not destroy the cities."
Abraham Challenges God's Justice Over Destroyed Generations
Legends of the Jews 5:160