What is the meaning of [Getting a taste of your own medicine]

Meaning: Being treated the way that you have been treating others