func (s *Set) List() []uint16 {
	v := make([]uint16, 0, s.Size())
	for item := range s.m {
		v = append(v, item)
	}
	return v
}
List returns a slice of all items. There is also StringSlice() and
IntSlice() methods for returning slices of type string or int.
package u16set
import (
	"fmt"
	"strings"
)
var (
	keyExists   = struct{}{}
	nonExistent uint16
)
const maxInt = int(^uint(0) >> 1)
type Set struct {
	m map[uint16]struct{}
}
func New(ts ...uint16) *Set {
	s := NewWithSize(len(ts))
	s.Add(ts...)
	return s
}
func NewWithSize(size int) *Set {
	return &Set{make(map[uint16]struct{}, size)}
}
func (s *Set) Add(items ...uint16) {
	for _, item := range items {
		s.m[item] = keyExists
	}
}
func (s *Set) Remove(items ...uint16) {
	for _, item := range items {
		delete(s.m, item)
	}
}
func (s *Set) Pop() uint16 {
	for item := range s.m {
		delete(s.m, item)
		return item
	}
	return nonExistent
}
func (s *Set) Pop2() (uint16, bool) {
	for item := range s.m {
		delete(s.m, item)
		return item, true
	}
	return nonExistent, false
}
func (s *Set) Has(items ...uint16) bool {
	has := false
	for _, item := range items {
		if _, has = s.m[item]; !has {
			break
		}
	}
	return has
}
func (s *Set) HasAny(items ...uint16) bool {
	has := false
	for _, item := range items {
		if _, has = s.m[item]; has {
			break
		}
	}
	return has
}
func (s *Set) Size() int {
	return len(s.m)
}
func (s *Set) Clear() {
	s.m = make(map[uint16]struct{})
}
func (s *Set) IsEmpty() bool {
	return s.Size() == 0
}
func (s *Set) IsEqual(t *Set) bool {
	if s.Size() != t.Size() {
		return false
	}
	equal := true
	t.Each(func(item uint16) bool {
		_, equal = s.m[item]
		return equal  
	})
	return equal
}
func (s *Set) IsSubset(t *Set) bool {
	if s.Size() < t.Size() {
		return false
	}
	subset := true
	t.Each(func(item uint16) bool {
		_, subset = s.m[item]
		return subset
	})
	return subset
}
func (s *Set) IsSuperset(t *Set) bool {
	return t.IsSubset(s)
}
func (s *Set) Each(f func(item uint16) bool) {
	for item := range s.m {
		if !f(item) {
			break
		}
	}
}
func (s *Set) Copy() *Set {
	u := NewWithSize(s.Size())
	for item := range s.m {
		u.m[item] = keyExists
	}
	return u
}
func (s *Set) String() string {
	v := make([]string, 0, s.Size())
	for item := range s.m {
		v = append(v, fmt.Sprintf("%v", item))
	}
	return fmt.Sprintf("[%s]", strings.Join(v, ", "))
}