def count_all_questions(groups, question_set_method):
    """ Adds up length of all question sets and returns the sum.

    :param groups: list of groups
    :param question_set_method: get_union_set or get_intersection_set
    """
    count = 0
    for group in groups:
        count += len(question_set_method(group))

    return count