You have a job that you value and enjoy, and it seems that you get along with everyone at the company except those few "bad apples" - your manager who harasses or retaliates against you and his superiors who are either reluctant to take action because they are biased and side with your manager no matter what, or because they want to "play it safe" by sweeping your reported problems under the rug.   

If you are not ready to quit and you believe that the situation can be remedied, it is very important that you don't become a victim of your anger. You should not allow yourself to lose your cool, to act or talk in a rude or offensive manner to your superiors, whether they are guilty of unlawful misconduct or not and not give them legitimate, legal reason to suspend or terminate you. This is the time to act like a true diplomat  - to voice your concerns in a compelling but courteous manner to all those who have the authority to address your issues without yelling at anyone or threatening your employer with a lawsuit.

As tempted as you might be to give your boss a piece of your mind - anger never serves any employee's best interests before litigation or after the lawsuit is filed, when treating the situation like business rather than personal battle is even more important for successful prosecution of a case in court.
 
 

As I meet more aggrieved employees, I notice a clear, repeating pattern - and employee works and performs well, enjoying working with his professional team and in his work environment, having a good relationship with his supervisor. At one point, his supervisors leaves or is being transferred to another department, and a new manager is being appointed to supervise the same employee. The new manager might be coming from outside, might not be experienced or even worse - might be having his first management position, upon receiving which he or she is eager to exercise his new power and control (what we commonly call as "power trip.")

Your new supervisor might have very different expectations from the previous one, which can be legitimate as every professional has different idea of what and how the performance of his or her subordinates should be. But when the new person abuses his power, nit-picking an employee, who has been working for the same company for much longer, this will necessarily cause undue stress and confrontation between the employee and his new manager.  This eventually leads to a range of legal claims by an employee - from harassment and hostile work environment, to retaliation (if the employee complains about his supervisor to the higher up, and as a result gets disciplined or terminated).

How can such problems at workplace and potential liability be effectively prevented and avoided?

One effective way to prevent this problem is to have the new manager undergo training and not only on discrimination, harassment and other laws that cover California workplace, but also generally on employee relations and on what makes a great manager who receives respect and admiration from his employees and who increases productivity, as opposed to one who creates bitterness, frustration and unnecessary stress on his employees. 

In addition, it is important to consider supervising closely the new manager and his ways of handling and communicating with his employees  - at least in the beginning stages of that new supervisor's job.