Abu Huraira reported Allah's Messenger (ﷺ) as saying
The Similitude of a believer is that of (a standing) crop which the air continues to toss from one side to another; in the same way a believer always (receives the strokes) of misfortune. The similitude of a hypocrite is that of a cypress tree which does not move until it is uprooted.
This hadith has been narrated on the authority of Zuhri with the same chain of transmitters, but with a slight variation of wording.
Ka'b reported that Allah's Messenger (ﷺ) said that the similitude of a believer is that of a standing crop in a field which is shaken by wind and then it comes to its original position but it stands at its roots. The similitude of a non-believer is that of a cypress tree which stands on its roots and nothing shakes it but it is uprooted (with) one (violent stroke).
Ka'b b. Malik reported on the authority of his father that the similitude of a believer is that of a standing crop. The wind sometimes shakes it and sometimes raises it up and then it comes to its destined end. And the similitude of a hypocrite is that of a cypress tree which is not affected by anything but is uprooted once for all.
This hadith has been narrated through a couple of other chains of transmitters, one which says "the similitude of the disbeliever" instead and another which agrees with the wording of the previous hadith.
This hadith has been narrated on the authority of Ibn Ka'b through another chain of transmitters but with " "the similitude of the disbeliever is that of a cypress tree".