func TestDifference(t *T) {
	empty := NewSet()
	assert.Equal(t, 0, Size(empty.Difference(empty)))
	ints1 := []interface{}{0, 1, 2, 3}
	ints2 := []interface{}{2, 3, 4}
	intsd := []interface{}{0, 1}
	s1 := NewSet(ints1...)
	s2 := NewSet(ints2...)
	assertSeqContentsSet(t, ints1, s1.Difference(empty))
	assert.Equal(t, 0, Size(empty.Difference(s1)))
	sd := s1.Difference(s2)
	assertSeqContentsSet(t, ints1, s1)
	assertSeqContentsSet(t, ints2, s2)
	assertSeqContentsSet(t, intsd, sd)
}
Test that Difference functions properly
package seq
import (
	. "testing"
	"github.com/stretchr/testify/assert"
)
func TestSetSeq(t *T) {
	ints := []interface{}{1, "a", 5.0}
	s := NewSet(ints...)
	ss := testSeqNoOrderGen(t, s, ints)
	s = ToSet(ss)
	var nilpointer *Set
	assert.Equal(t, 0, Size(s))
	assert.Equal(t, nilpointer, s)
	assert.Equal(t, 0, len(ToSlice(s)))
}
func TestSetVal(t *T) {
	ints := []interface{}{0, 1, 2, 3, 4}
	ints1 := []interface{}{0, 1, 2, 3, 4, 5}
	s := NewSet()
	assert.Equal(t, 0, Size(s))
	s, ok := s.SetVal(0)
	assertSeqContentsSet(t, []interface{}{0}, s)
	assert.Equal(t, true, ok)
	s = NewSet(ints...)
	s1, ok := s.SetVal(5)
	assertSeqContentsSet(t, ints, s)
	assertSeqContentsSet(t, ints1, s1)
	assert.Equal(t, true, ok)
	s2, ok := s1.SetVal(5)
	assertSeqContentsSet(t, ints1, s1)
	assertSeqContentsSet(t, ints1, s2)
	assert.Equal(t, false, ok)
}
func TestDelVal(t *T) {
	ints := []interface{}{0, 1, 2, 3, 4}
	ints1 := []interface{}{0, 1, 2, 3}
	ints2 := []interface{}{1, 2, 3, 4}
	ints3 := []interface{}{1, 2, 3, 4, 5}
	s := NewSet()
	assert.Equal(t, 0, Size(s))
	s, ok := s.DelVal(0)
	assert.Equal(t, 0, Size(s))
	assert.Equal(t, false, ok)
	s = NewSet(ints...)
	s1, ok := s.DelVal(4)
	assertSeqContentsSet(t, ints, s)
	assertSeqContentsSet(t, ints1, s1)
	assert.Equal(t, true, ok)
	s1, ok = s1.DelVal(4)
	assertSeqContentsSet(t, ints1, s1)
	assert.Equal(t, false, ok)
	s2, ok := s.DelVal(0)
	assertSeqContentsSet(t, ints, s)
	assertSeqContentsSet(t, ints2, s2)
	assert.Equal(t, true, ok)
	s2, ok = s2.DelVal(0)
	assertSeqContentsSet(t, ints2, s2)
	assert.Equal(t, false, ok)
	s3, ok := s2.SetVal(5)
	assertSeqContentsSet(t, ints2, s2)
	assertSeqContentsSet(t, ints3, s3)
	assert.Equal(t, true, ok)
}
func GetVal(t *T) {
	s := NewSet()
	v, ok := s.GetVal(1)
	assert.Equal(t, nil, v)
	assert.Equal(t, false, ok)
	s = NewSet(0, 1, 2, 3, 4)
	v, ok = s.GetVal(1)
	assert.Equal(t, 1, t)
	assert.Equal(t, true, ok)
	s, _ = s.DelVal(1)
	v, ok = s.GetVal(1)
	assert.Equal(t, nil, v)
	assert.Equal(t, false, ok)
	s, _ = s.SetVal(1)
	v, ok = s.GetVal(1)
	assert.Equal(t, 1, t)
	assert.Equal(t, true, ok)
	s, _ = s.DelVal(0)
	v, ok = s.GetVal(0)
	assert.Equal(t, nil, v)
	assert.Equal(t, false, ok)
	s, _ = s.SetVal(5)
	v, ok = s.GetVal(5)
	assert.Equal(t, 5, t)
	assert.Equal(t, true, ok)
}
func TestSetSize(t *T) {
	s := NewSet()
	assert.Equal(t, uint64(0), s.Size())
	s, _ = s.SetVal(0)
	assert.Equal(t, uint64(1), s.Size())
	s = NewSet(0, 1, 2)
	assert.Equal(t, uint64(3), s.Size())
	s, _ = s.SetVal(3)
	assert.Equal(t, uint64(4), s.Size())
	s, _ = s.SetVal(3)
	assert.Equal(t, uint64(4), s.Size())
	s, _ = s.DelVal(3)
	assert.Equal(t, uint64(3), s.Size())
	s, _ = s.DelVal(3)
	assert.Equal(t, uint64(3), s.Size())
	s, _ = s.DelVal(0)
	assert.Equal(t, uint64(2), s.Size())
	s, _ = s.SetVal(5)
	assert.Equal(t, uint64(3), s.Size())
}
func TestUnion(t *T) {
	empty := NewSet()
	assert.Equal(t, 0, Size(empty.Union(empty)))
	ints1 := []interface{}{0, 1, 2}
	ints2 := []interface{}{3, 4, 5}
	intsu := append(ints1, ints2...)
	s1 := NewSet(ints1...)
	s2 := NewSet(ints2...)
	assertSeqContentsSet(t, ints1, s1.Union(empty))
	assertSeqContentsSet(t, ints1, empty.Union(s1))
	su := s1.Union(s2)
	assertSeqContentsSet(t, ints1, s1)
	assertSeqContentsSet(t, ints2, s2)
	assertSeqContentsSet(t, intsu, su)
}
func TestIntersection(t *T) {
	empty := NewSet()
	assert.Equal(t, 0, Size(empty.Intersection(empty)))
	ints1 := []interface{}{0, 1, 2}
	ints2 := []interface{}{1, 2, 3}
	ints3 := []interface{}{4, 5, 6}
	intsi := []interface{}{1, 2}
	s1 := NewSet(ints1...)
	s2 := NewSet(ints2...)
	s3 := NewSet(ints3...)
	assert.Equal(t, 0, Size(s1.Intersection(empty)))
	assert.Equal(t, 0, Size(empty.Intersection(s1)))
	si := s1.Intersection(s2)
	assert.Equal(t, 0, Size(s1.Intersection(s3)))
	assertSeqContentsSet(t, ints1, s1)
	assertSeqContentsSet(t, ints2, s2)
	assertSeqContentsSet(t, ints3, s3)
	assertSeqContentsSet(t, intsi, si)
}