// Creates and returns a reference to a set from an existing slice func NewSetFromSlice(s interface{}) Set { a := NewSet() slice := utils.InterfaceSlice(s) for _, item := range slice { a.Add(item) } return a }
func CheckCount(slice interface{}, expected int, t *testing.T, descr string) { slice_ := utils.InterfaceSlice(slice) if len(slice_) != expected { t.Errorf("%v expected %v, have %v", descr, expected, len(slice_)) } }