@staticmethod
def count_in_out_topic(topic, lst):
    """Count the number of incoming and outgoing links."""
    in_cnt = 0
    out_cnt = 0
    for element in lst:
        if element.get_value('Topic') == topic:
            in_cnt += 1
        else:
            out_cnt += 1
    return in_cnt, out_cnt
