Long ago， in the City of Bagdad， in the land of Persia， there lived a merchant called Ali Cogia. Over the years， Ali Cogia had saved one thousand pieces of gold. He put this gold into a big jar of clay. On top he put some olives. He sealed the jar and took it to a merchant friend who had a fine， big shop and a warehouse behind it.
“I am going to join a camel caravan and see the world，” Ali Cogia said to his friend. “But before I go， I should like to ask you for a favour. Will you be good enough to keep this jar of olives safe for me until I return？”
“Take the keys to my warehouse，” said his friend. “Put your jar anywhere you like. Upon my honor， when you come back， you will find it just as you left it.”
So Ali Cogia put his jar in a corner of the warehouse and went off to see the world.
Seven years passed. The rich merchant never thought of the jar his friend Ali Cogia had left in his care. But then one evening at supper， his wife said， “Dear husband， I would have killed some olives with our meat tonight. But there are none in the house.”
“That reminds me！” said the merchant. “Before Ali Cogia went away， he left a jar of olives in my warehouse. Let's open that jar， and we'll have some olives tonight！”
“Oh no！” said his wife. “You promised to keep that jar safe. Just think how ashamed you will be when Ali Cogia comes back and sees that the seal of the jar is broken！”
But the merchant took an oil lamp and a plate and went to the warehouse. He broke the seal and opened Ali Cogia's jar. The olives were no longer fit to eat. They were rotten and moldy. Hr tiled the jar and poured out the moldy olives， and a piece of gold fell into the plate.
The merchant emptied the jar and stole all the gold. In the morning he bought some fresh olives. He filled Ali Cogia's jar， sealed it， and put it back in its place.
A month later Ali Cogia came home. He did not bring back any riches - but he had seen quite a bit of the world. He went straight to his merchant friend to get the jar. But when he opened it， he saw that the gold was gone.
Ali Cogia rushed back to his friend and said， “Before I felt， I put a thousand pieces of gold under the olives in that jar. Now they are gone！ Has anyone been near the jar？ If you needed the gold， that's all right - as long as I know I'll get it back.”
“My dear friend Ali Cogia，” the merchant said， “you found your jar just where you left it. You told me there were olives in it. You said nothing about gold！”
Ali Cogia listened to his friends face - and Ali Cogia was very troubled. “My friend has been false to me，” he said to himself. “I must go to the judge and ask for justice. The judge will see that I speak the truth. He will tell my false friend to give me back my thousand pieces of gold.”
So Ali Cogia and the merchant went before the judge. The judge listened to both of them. He looked at Ali Cogia， who had traveled for seven years in faraway lands and still was poor. He looked at the rich merchant， who had stayed home in Bagdad， talking care of his shop and his family.
“It is clear to me，” said the judge to Ali Cogia， “that you are falsely accusing this honorable merchant.” And the judge sent them away.
“There is only one thing to do，” Ali Cogia thought. “I must write a letter to the Caliph， our great prince who rules wisely over all of Persia. He will hear my case and give me justice.”
When the Caliph rode into the city， Ali Cogia threw himself on the ground before him. And he offered the Caliph the letter. The Caliph read the letter at once and said， “I will hear your case. See that you and his merchant are in the great hall of the palace tomorrow morning.”
This Caliph often disguised himself and went about the city at night. And that very night， the Caliph and his minister went out to see what was happening in Bagdad.
In a square near the marketplace， some children were playing in the moonlight.
“Let's play the case of Ali Cogia，” said the oldest bay. “I will be the judge.”
“You'll be Ali Cogia，：” he said to one of his playmates， and to another， “You'll be the merchant who was to keep the jar safe.”
“You two，” he said， turning to two other children， “will play alive merchants.”
“Why， this is the very case I will hear tomorrow morning，” the Caliph said to his minister.
“Let's listen to what the children say about it！ We can hide in this gateway and watch.”
The boy judge then turned to the boy who played the rich merchant. “What is your answer？” he asked. And the make-believe merchant said， “Upon my honor， I swear， I did not touch that jar.”
“Ali Cogia， bring me your jar，” ordered the boy judge. He pretended to open the jar and to eat some lives. “How fresh and tasty they are，” he said.
“Come forward and taste these olives，” he then said to the boys who were playing the olive merchants.
Now these olive merchants tasted the make-believe olives from the make-believe jar of Ali Cogia.
“Your honor，” they said， “these olives are fresh. They are this year's olives. If they had been put into the jar seven years ago， they would be rotten and moldy now.”
The boy judge turned to the boy who was playing the rich merchant. “You know you have lied，” he said to him. “You know you have sworn falsely before me. And you know you have stolen your friend Ali Cogia's thousand pieces of gold. Go this instant， bring them here， and return them to Ali Cogia！”
“How very， very interesting！” said the Caliph to his minister. “These children have judges more wisely than the real judge. Follow the boy who played the judge. She that he comes to the great hall in the morning. Bring two of the city's olive merchants with you. Bring the judge who tried this case before. And tell Ali Cogia to bring his jar of olives.”
The next morning， the Caliph said to the boy， “I watched you play judge last night. This morning you shall judge the case of the real Ali Cogia！”
The boy judge looked around the great hall at all the people.
“Don't be shy，” said the Caliph to him. “I'm right here by your side. Go ahead！”
And so the boy judge began. Ali Cogia stated his case. Then he said， “Great Caliph， your highness！ And your honor， my judge！ I hope for justice！”
The rich merchant stated his case too.
The boy judge asked him if he had ever opened Ali Cogia's jar. And the merchant started to swear that he had never done so.
“Don't swear unless I order you to，” said the boy judge. And he called for Ali Cogia's jar of olives.
The boy judge invited the Caliph and the olive merchants to taste the olives. The olives were fresh！ “We are quite sure，” said the olive merchants， “they are this year's olives.”
Now it was clear to everyone in the great hall that the rich merchant had lied and that he had stolen Ali Cogia's thousand pieces of gold. The merchant confessed.
The boy judge stood up before the Caliph.
“Your highness，” he said. “I cannot truly judge this case. I am a young boy. It is up to you to give justice.”
The Caliph sentenced the merchant to jail and ordered him to give the thousand pieces of gold back to Ali Cogia.
The Caliph gave the boy fine presents and a hundred pieces of gold.
Then the Caliph turned to the judge who had first tried the case. “Never again judge in haste，” he said to him. “Learn from this boy how to find out the truth and to judge with care.”