Apparently having black friends negates any racist thing you say.
Person 2: Dude...what's wrong with you?
Person 1: It's okay, I have black friends. I can say this.
Person 2: I don't think it works that way.
Can be interepreted as a threat, but more usually a point of pride.
Dont worry bro, I have black friends.