John 2:23-25

Now when he was in Jerusalem at the Passover Feast, many believed in his name when they saw the signs that he was doing. 24 But Jesus on his part did not entrust himself to them, because he knew all people 25 and needed no one to bear witness about man, for he himself knew what was in man.

Remember that the aim of John's Gospel is that people might believe in Jesus. John 20:31: "These are written so that you may believe that Jesus is the Christ, the Son of God, and that by believing you may have life in his name." This has been underlined several times in chapters 1 and 2.

http://www.desiringgod.org/resource-library/sermons/he-knew-what-was-in-man