func (l *PacketIntervalList) PushBack(v PacketInterval) *PacketIntervalElement {
	l.lazyInit()
	return l.insertValue(v, l.root.prev)
}
PushBack inserts a new element e with value v at the back of list l and returns e.
package utils
type PacketIntervalElement struct {
	next, prev *PacketIntervalElement
	list *PacketIntervalList
	Value PacketInterval
}
func (e *PacketIntervalElement) Next() *PacketIntervalElement {
	if p := e.next; e.list != nil && p != &e.list.root {
		return p
	}
	return nil
}
func (e *PacketIntervalElement) Prev() *PacketIntervalElement {
	if p := e.prev; e.list != nil && p != &e.list.root {
		return p
	}
	return nil
}
type PacketIntervalList struct {
	root PacketIntervalElement  
	len  int                    
}
func (l *PacketIntervalList) Init() *PacketIntervalList {
	l.root.next = &l.root
	l.root.prev = &l.root
	l.len = 0
	return l
}
func NewPacketIntervalList() *PacketIntervalList { return new(PacketIntervalList).Init() }
func (l *PacketIntervalList) Len() int { return l.len }
func (l *PacketIntervalList) Front() *PacketIntervalElement {
	if l.len == 0 {
		return nil
	}
	return l.root.next
}
func (l *PacketIntervalList) Back() *PacketIntervalElement {
	if l.len == 0 {
		return nil
	}
	return l.root.prev
}
func (l *PacketIntervalList) lazyInit() {
	if l.root.next == nil {
		l.Init()
	}
}
func (l *PacketIntervalList) insert(e, at *PacketIntervalElement) *PacketIntervalElement {
	n := at.next
	at.next = e
	e.prev = at
	e.next = n
	n.prev = e
	e.list = l
	l.len++
	return e
}
func (l *PacketIntervalList) insertValue(v PacketInterval, at *PacketIntervalElement) *PacketIntervalElement {
	return l.insert(&PacketIntervalElement{Value: v}, at)
}
func (l *PacketIntervalList) remove(e *PacketIntervalElement) *PacketIntervalElement {
	e.prev.next = e.next
	e.next.prev = e.prev
	e.next = nil  
	e.prev = nil  
	e.list = nil
	l.len--
	return e
}
func (l *PacketIntervalList) Remove(e *PacketIntervalElement) PacketInterval {
	if e.list == l {
		l.remove(e)
	}
	return e.Value
}
func (l *PacketIntervalList) PushFront(v PacketInterval) *PacketIntervalElement {
	l.lazyInit()
	return l.insertValue(v, &l.root)
}