This has to be one of the best quotes ever. If you keep this in mind you will be able to recognize the other person who will treat you as you wish to be treated. Remember, they are a part of you so due diligence and reciprocal behavior will be expected.
Walking away is okay. When the thought comes to mind, "I'm not happy" or "I'm done with this", walk away knowing you're acting in your own best interest. I love the phrase, "Take the lesson, leave the teacher". Express gratitude and be on your way. There much to experience and discover without the limitations.