I always think like, if it wasn't me, it would be some other random person who just happened to walk on by to satisfy their impulses that they have at that moment, sometimes out of boredom, sometimes taking out their frustration, sometimes drug-induced. Don't take it personally.
Kids in groups, especially the sort who act all tough on the street, often behave like a sort of predatory apes, trying to impress one another with bravado and jokes at the expense of some poor passerby. Then there's also older cretins who sometimes randomly yell at you for no reason at all. Just frustration and pain boiling up from inside of them. Maybe they hate their jobs and life and you are the random person they take it out on.
One day I feel like if I'm caught in an especially bad mood, I really might be that "one person they shouldn't have messed with", but I hope I can remember at such a moment that it's not really worth it. It's really just a low, gutter sort of behavior that is not worth anyone's time. It should be pitied that these people are so stuck in these primal urges, it's not the type of mentality that will get them ahead in life or make them happy. I also try to remember that people are multi-faceted and their behavior is unpredictable. They might be nice people at other times. The way people behave is merely a reflection of their state of consciousness at that moment. That **** who called you out in his car, might be a good father. It's not in the way of things that people are always going to be nice to you, if you accept this unpredictability and have no expectancy of how others should or should not behave, they become a bit more forgivable and the world becomes a bit less hostile.