@staticmethod
def _add_extra_routes(old, add):
    """Add two lists of extra routes.

        Exact duplicates (both destination and nexthop) in old and add are
        merged into one item.
        Same destinations with different nexthops are accepted and all of
        them are returned.
        Overlapping destinations are accepted and all of them are returned.
        """
    routes_dict = {}
    for r in (old + add):
        dst = r['destination']
        nexthop = r['nexthop']
        if dst not in routes_dict:
            routes_dict[dst] = set()
        routes_dict[dst].add(nexthop)
    routes_list = []
    for dst, nexthops in routes_dict.items():
        for nexthop in nexthops:
            routes_list.append({'destination': dst, 'nexthop': nexthop})
    return routes_list
