Liu Xia Hui and Shao Lian are names mentioned in Confucius's Analects and Mencius as "having transgressed and abased themselves." Says the Analects, XVIII.8:
Men who withdrew from society: Bo Yi, Shu Qi, Yu Zhong, Yi Yi, Zhu Zhang, Liu Xia Hui, Shao Lian. The Master commented, "Not to lower their purposes or to allow themselves to be humiliated described, perhaps, Bo Yi and Shu Qi." Of Liu Xia Hui and Shao Lian he said, "They, indeed, lowered their purpose and allowed themselves to be humiliated, but their words were consistent with their station, and their deeds with circumspection. That was all." Of Yu Zhong and Yi Yi he said, "They gave free rein to their words while living as recluses, but they were unsullied in character and showed sound judgment in accepting their dismissal. I, however, am different. I have no preconceptions about the permissible and the impermissible."

Mencius, II.1.9 says,

Mencius said, "Bo Yi would serve only the right prince and befriend only the right man. He would not take his place at the court of an evil man, nor would he converse with him. For him to do so would be like sitting in mud and pitch wearing a court cap and gown. He pushed his dislike for evil to the extent that, if a fellow villager in his company had his cap awry, he would walk away without even a backward look, as if afraid of being defiled. Hence even when a feudal lord made advances in the politest language, he would repel them. He repelled them simply because it was beneath him to go to the feudal lord.

"Liu Xia Hui, on the other hand, was not ashamed of a prince with a tarnished reputation, neither did he disdain a modest post. When in office, he did not conceal his own talent, and always acted in accordance with the Way. When he was passed over he harbored no grudge, nor was he distressed even in straitened circumstances. That is why he said, "You are you and I am I. Even if you were to be stark naked by my side, how could you defile me?" Consequently, he was in no hurry to take himself away, and looked perfectly at ease in the other man's company, and would stay when pressed. He stayed when pressed, simply because it was beneath him to insist on leaving."

Mencius added, "Bo Yi was too straight-laced; Liu Xia Hui was not dignified enough. A gentleman would follow neither extreme."

See also, Mencius, V.2.1.