Calculates the union of two sets.