I would say there are a few keys for ensuring friendships don't end up like that:
1.Observe the behaviour of a person for a while in class or in a group to see if it's the kind of person you really like. Most of all observe their behaviour towards others. If the person is unkind to others it is a bad sign already.
2.Don't spend too much time with one friend. I average about twice a month in terms of long visits with any one friend, so that we don't get tired of each other. That may be a little too extreme for some of you... I suggest at least a good week between long visits for any one friend.