def VisitUnionType(self, union):
    if (len(union.type_list) > self.max_length):
        return self.generic_type
    elif (self.generic_type in union.type_list):
        return self.generic_type
    else:
        return union
def VisitUnionType(self, union):
    if (len(union.type_list) > self.max_length):
        return self.generic_type
    elif (self.generic_type in union.type_list):
        return self.generic_type
    else:
        return union