According to Shishuoxinyu from the Great Tang Dynasty, one day after he had finished a court session, Tang Taizong (Emperor of the Tang Dynasty) walked by a tree and was delighted to see that its branches and leaves were flourishing. Standing next to him, Yuwenshiji tried to curry favour with Tang Taizong and kept praising the tree. Tang Taizong scolded him solemnly: "Wei Zheng advised me to keep a distance from those with lowly character. Although I suspected that you might be such a person, I was not sure. But now I know." Yuwenshiji was terrified and begged for forgiveness.
Confucius said, "I hate those who harm the country with their sharp mouths." He also said, "One should keep a distance from those who like to curry favour." Those who are used to ingratiating themselves are good at figuring out what their superiors have in mind and how to make them happy. With their superiors being happy, they can make up things and distort the truth, and succeed in harming those who are righteous and honest. So the sages always are on guard for those who curry favour. Tang Taizong's scolding Yuwenshiji right in his face is a good example.
To distinguish a person of lowly character from the rest may not be that difficult. If a person talks straightforwardly and dares to say what is on his mind, he is more righteous. Those who like to ingratiate themselves and curry favour are the cunning ones.