// Determines if every item in the other set is in this set.
8880
func (set StringSet) IsSubset(other StringSet) bool {
	for elem := range set {
		if !other.Contains(elem) {
			return false
		}
	}
	return true
}
1333542
func (set StringSet) Difference(other StringSet) StringSet {
	differencedSet := NewStringSet()
	for elem := range set {
		if !other.Contains(elem) {
			differencedSet.Add(elem)
		}
	}
	return differencedSet
}
74315
func (s *SyncedSet) Intersect(other *SyncedSet) *SyncedSet {
	newSet := NewSyncedSet()
	for k := range s.set {
		if other.Contains(k) {
			newSet.Add(k)
		}
	}
	return &newSet
}
1042966
func Contains(a interface{}, b interface{}) BoolPredicate {
	return func() bool {
		aval, ok := a.([]string)
		if !ok {
			return false
		}
		bval, ok := b.(string)
		if !ok {
			return false
		}
		for _, v := range aval {
			if v == bval {
				return true
			}
		}
		return false
	}
}
1078511
func (s *Set) Contains(key interface{}) bool {
	_, ok := s.skiplist.Get(key)
	return ok
}
33219
func (s *Set) Intersect(t *Set) *Set {
	ls, lt := len(s.items), len(t.items)
	if lt < ls {
		s, t = t, s
	}
	res := New(ls)

	var offset int
	var ok bool
	for _, v := range s.items {
		if offset, ok = index(t.items, v, offset); ok {
			res.Add(v)
		}
	}
	return res
}
189695
func (s Byte) HasAll(items ...byte) bool {
	for _, item := range items {
		if !s.Has(item) {
			return false
		}
	}
	return true
}
182990
func (r Range) Contains(other Range) bool {
	return !r.Start.After(other.Start) && !r.End.Before(other.End)
}
1094321
func (s *Set) Intersects(t *Set) bool {
	ls, lt := len(s.items), len(t.items)
	if lt < ls {
		ls, lt = lt, ls
		s, t = t, s
	}
	if ls == 0 || s.items[0] > t.items[lt-1] || t.items[0] > s.items[ls-1] {
		return false
	}

	offset := 0
	for _, v := range s.items {
		pos, ok := index(t.items, v, offset)
		if ok {
			return true
		} else if pos >= lt {
			return false
		}
		offset = pos
	}
	return false
}
664844
func (s Set) Contains(value string) bool {
	_, ok := s[value]
	return ok
}
1010687
func (s *OrderedSet) Equal(other *OrderedSet) bool {
	if s.Cardinality() != other.Cardinality() {
		return false
	}

	for e, i := range s.m {
		if ci, ok := other.m[e]; !ok || ci != i {
			return false
		}
	}

	return true
}
1253309
func (s Byte) Has(item byte) bool {
	_, contained := s[item]
	return contained
}
928575
func (s Int32) HasAll(items ...int32) bool {
	for _, item := range items {
		if !s.Has(item) {
			return false
		}
	}
	return true
}
1114823
func (s *Set) IsSubset(t Interface) (subset bool) {
	s.l.RLock()
	defer s.l.RUnlock()

	subset = true

	t.Each(func(item interface{}) bool {
		_, subset = s.m[item]
		return subset
	})

	return
}
387322
func (aabb *AABB) Contains(other AABB) bool {
	return aabb.Lower.X <= other.Lower.X &&
		aabb.Upper.X >= other.Upper.X &&
		aabb.Lower.Y <= other.Lower.Y &&
		aabb.Upper.Y >= other.Upper.Y
}
915944
func (s Int32) Has(item int32) bool {
	_, contained := s[item]
	return contained
}
333489
func (s1 StringSet) Equals(s2 StringSet) bool {
	if len(s1) != len(s2) {
		return false
	}
	for key, _ := range s1 {
		if _, ok := s2[key]; !ok {
			return false
		}
	}
	return true
}