Some people indulge in philosophical speculation and think much of themselves. Perhaps they have studied a little Vedanta. But a man cannot be egotistic if he has true knowledge. In other words, in samadhi man becomes one with God and gets rid of his egotism. True knowledge is impossible without samadhi. In samadhi man becomes one with God. Then he can have no egotism.
Do you know what it is like? Just at noon the sun is directly overhead. If you look around then, you do not see your shadow. Likewise, you will not find the 'shadow' of ego after attaining Knowledge, samadhi.
But if you see in anyone a trace of 'I-consciousness' after the attainment of true Knowledge, then know that it is either the 'ego of Knowledge' or the 'ego of Devotion' or the 'servant ego'. It is not the 'ego of ignorance'.