As people from various backgrounds get the opportunity to mingle, some obviously have a hard time with how to handle these encounters. They harbour an uneasiness when faced with the differences based on some false assumptions that they've made, maybe due to misinformation or (often inaccurate) cultural stereotypes. e.g.
when a black person meets a white person, that black person is particularly concerned if the white person is racist. So they decide to bring forth what they perceive to be the elephant in the room, by preemptively expressing that they themselves are very open to cultural differences. Now, the way this is done takes some interesting forms, from the more subtle:
I have a friend from [insert some exotic country here].
I love [insert some singer from some minority group here]
To the more awkward:
What's up bro!
[insert awkward racial remark of your liking here]
It comes to no surprise that some would even choose to compensate by exhibiting a bold racist behaviour that, they think, should be received with some reverse psychology acrobatics: I'm preemptively making racist jokes, because I want to show you that I'm not actually racist and rather open. (I'm also kinda covering my ass now, in case I do happen to trip over my tongue later and say something really out of place).
Sadly, an increasing amount of people who behave like this also think that it's ok and that racism is now in the eye of the beholder. So they will tell their jokes to Kevin, who they've just barely met and if Kevin takes offence, then it's Kevin who's too sensitive about that kind of humour. So they will apologize by saying something like relax bro, I didn't mean it in a racist way. I have many black friends. Racism doesn't exist anymore. Chill, have a sense of humour. They never stop to wonder, did Kevin, who is from Ghana, connect with their African American stereotyped jokes? Do his black friends actually even call him "bro"? Does he or the people he associates with actually use the n word?
Do they actually acknowledge that this behaviour isn't acceptable? The way they reason is, I'm not racist, so I can just keep calling my black friends n, as long as I don't mean it in a negative way. So it's not surprising that later they'll try the exact same jokes on Robert, thinking he might be of the "more open minded inclination".
My tip when it comes to befriend minorities (this is going to be a let down): They're just people, get to know them like you would anybody else. Don't attempt any "hacks", don't play games, don't test them thinking that the outcome should be different from any other human being. Take the time to know the person, don't assume that you've figured them out based on their gender, orientation or physical appearance.