def _build_group_assignment_lookup(annos):
    """
    Builds a lookup as a dictionary of groupIds to formId lists
    """
    _assignments = {}
    if annos is not None:
        for anno in annos:
            _form_id = None
            _group_id = None
            kvs = anno.getMapValue()
            for kv in kvs:
                if kv.name == 'formId':
                    _form_id = kv.value
                elif kv.name == 'groupId':
                    _group_id = kv.value
            _assignments.setdefault(int(_group_id), set()).add(_form_id)
    return _assignments
