Hillel and Muhammad: two (similar) stories, one Golden Rule

Here’s a frequently told story about Hillel, one of the most influential historical figures in Judaism:

Once there was a gentile who came before Shammai, and said to him: “Convert me on the condition that you teach me the whole Torah while I stand on one foot. Shammai pushed him aside with the measuring stick he was holding. The same fellow came before Hillel, and Hillel converted him, saying: That which is despicable to you, do not do to your fellow, this is the whole Torah, and the rest is commentary, go and learn it.” – Babylonian Talmud, Shabbat 31a

Compare that account to this well known hadith of Muhammad, who founded Islam:

A Bedouin came to the prophet, grabbed the stirrup of his camel and said: O the messenger of God! Teach me something to go to heaven with it. Prophet said: “As you would have people do to you, do to them; and what you dislike to be done to you, don’t do to them. Now let the stirrup go! [This maxim is enough for you; go and act in accordance with it!]” - Kitab al-Kafi, vol. 2, p. 146

The Golden Rule occurs in just about every major religion. But the similarity is interesting: A stranger confronts a wise man. The wise man replies with the Golden Rule, then advises the man to go and learn the rest.

I wonder what other religions and cultures explain the Golden Rule in this way, too…