func intervalFromEvents(events []*watchCacheEvent) *watchCacheInterval { … } func bufferFromEvents(events []*watchCacheEvent) *watchCacheIntervalBuffer { … } func generateEvents(start, end int) []*watchCacheEvent { … } func verifyEvent(ok bool, event, expectedEvent *watchCacheEvent) error { … } func verifyNoEvent(ok bool, event *watchCacheEvent) error { … } func TestIntervalBufferIsFull(t *testing.T) { … } func TestIntervalBufferIsEmpty(t *testing.T) { … } func TestIntervalBufferNext(t *testing.T) { … } func TestFillBuffer(t *testing.T) { … } func TestCacheIntervalNextFromWatchCache(t *testing.T) { … } func TestCacheIntervalNextFromStore(t *testing.T) { … }