func (ms *MembershipSet) AddExpansion(onr *v0.ObjectAndRelation, expansion *v0.RelationTupleTreeNode) (FoundSubjects, bool, error) {
	onrString := tuple.StringONR(onr)
	existing, ok := ms.objectsAndRelations[onrString]
	if ok {
		return existing, false, nil
	}
	foundSubjectsMap := map[string]FoundSubject{}
	err := populateFoundSubjects(foundSubjectsMap, onr, expansion)
	if err != nil {
		return FoundSubjects{}, false, err
	}
	fs := FoundSubjects{
		subjects: foundSubjectsMap,
	}
	ms.objectsAndRelations[onrString] = fs
	return fs, true, nil
}
AddExpansion adds the expansion of an ONR to the membership set. Returns false if the ONR was already added.

NOTE: The expansion tree *should* be the fully recursive expansion.
package membership
import (
	"fmt"
	v0 "github.com/authzed/authzed-go/proto/authzed/api/v0"
	"github.com/authzed/spicedb/pkg/tuple"
)
type MembershipSet struct {
	objectsAndRelations map[string]FoundSubjects
}
func (ms *MembershipSet) SubjectsByONR() map[string]FoundSubjects {
	return ms.objectsAndRelations
}
type FoundSubjects struct {
	subjects map[string]FoundSubject
}
func (fs FoundSubjects) ListFound() []FoundSubject {
	found := []FoundSubject{}
	for _, sub := range fs.subjects {
		found = append(found, sub)
	}
	return found
}
func (fs FoundSubjects) LookupSubject(subject *v0.ObjectAndRelation) (FoundSubject, bool) {
	onrString := tuple.StringONR(subject)
	found, ok := fs.subjects[onrString]
	return found, ok
}
type FoundSubject struct {
	subject *v0.ObjectAndRelation
	relationships *tuple.ONRSet
}
func (fs FoundSubject) Subject() *v0.ObjectAndRelation {
	return fs.subject
}
func (fs FoundSubject) Relationships() []*v0.ObjectAndRelation {
	return fs.relationships.AsSlice()
}
func NewMembershipSet() *MembershipSet {
	return &MembershipSet{
		objectsAndRelations: map[string]FoundSubjects{},
	}
}