Previous studies on generalized exchange have argued that group plays an important role in the emergence of cooperative society. To examine to what extent the role of a group is important, we conducted computer simulations in which players decide whether to give resources to members of a society composed of two groups. We examined whether a society consisting of any of the possible conceivable strategies (65536 strategies total) could resist invasion by an unconditional defector (ALLD) and an unconditional cooperator (ALLC). The results showed that universalist strategies, which give resources to both in-group members and out-group members equally, and in-group favoring strategies, which give resources to in-group members more than outgroup members, could resist invasion. Furthermore, we found that in-group favoring strategies could exclude ALLC from the circle of resource flow more easily than universalist strategies. These results imply that it may be necessary to employ an in-group favoring strategy that utilizes the group membership information of other people in order to maintain generalized exchange in a society composed of two groups.