The Messenger of Allah ﷺ said, "The believer is like a tender stalk of grain. The wind bends it one moment and straightens it the next. The hypocrite is like a cedar tree, standing firm until it is uprooted all at once."
قال رسول الله ﷺ: مثل المؤمن كالخامة من الزرع، تفيئها الريح مرة وتعدلها مرة، ومثل المنافق كالأرزة لا تزال حتى يكون انجعافها مرة واحدة.
Bukhari reported it in the Book of Illnesses (5643), from the hadith of Sufyan, from Saad bin Ibrahim, from Abdullah bin Kaab, from his father Kaab bin Malik, as mentioned. The wording given here is his.Muslim also reported it in the Book of the Description of the Resurrection (2810: 59), through another route, from Ibn Kaab, from Kaab bin Malik, with the same content, and in it, "The example of the disbeliever is like the cedar tree."