R. Eliezer Hamodai says: He (Moses) is one of the four tzaddikim to whom He gave a hint (of what was to follow): Two took the hint and two did not take it. Moses was given a hint but did not take it. Jacob was given a hint but did not take it. David and Mordecai were given a hint and they took it. Moses, wherefrom? "and place it in the ears of Joshua." He was thereby intimating that Joshua would cause Israel to inherit the land,
Rabbi Eliezer Hamodai on Moses Was One of Four Great Tzaddikim
Mekhilta Tractate Amalek 2:5