def get_exb_group_best_con(exb_group_ids_list, id2exb_pair_dic):
    """
    Given a list of site IDs connected at exon borders with intron-spanning
    reads. Only one of them should have a connection in both directions,
    while the other have different connections.

    >>> exb_group_ids_list = ['id1', 'id2', 'id3']
    >>> id2exb_pair_dic = {'id1': 'id2', 'id2': 'id3', 'id3': 'id2'}
    >>> get_exb_group_best_con(exb_group_ids_list, id2exb_pair_dic)
    ['id2', 'id3']

    """
    assert exb_group_ids_list, "exb_group_ids_list empty"
    sids = []
    for sid in exb_group_ids_list:
        pid = id2exb_pair_dic[sid]
        sid2 = id2exb_pair_dic[pid]
        if sid == sid2:
            sids = [sid, pid]
            sids.sort()
            break
    assert sids, "no exon border site pair with connections in both directions found for %s" %(','.join(exb_group_ids_list))
    return sids