A Jewish story goes: I went up to Heaven in a dream and stood at the Gates of Paradise in order to observe the procedure of the Heavenly Tribunal. I watched as a learned Rabbi approached and wished to enter. "Day and night," he said, "I studied the Holy Torah."
"Wait," said the Angel. "We will investigate whether your study was for its own sake or whether it was a matter of profession and for the sake of honors.
A Righteous Person [a Zaddik] next approached. "I fasted much," he said, "I underwent many ritual cleansings; I studied the Zohar the mystical commentary on the Torah day and night."
"Wait," said the Angel, "until we have completed our investigation to learn whether you motives were pure."
Then a tavern-keeper drew near. "I kept an open door and fed without charge every poor man who came into my inn," he said.
The Heavenly Portals were opened to him.