You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: link_cache_test.go
    path of file: ./repos/client/go/libkb
    
    the code of the file until where you have to start completion: // Copyright 2015 Keybase, Inc. All rights reserved. Use of
// this source code is governed by the included BSD license.

package libkb

import (
	"sync"
	"testing"
	"time"
)

func randChainLink() ChainLink {
	id, err := RandBytes(LinkIDLen)
	if e
    
func TestLinkCacheAtime(t *testing.T) {
	c := NewLinkCache(10, time.Hour)
	defer c.Shutdown()

	// Dangerous, but as long as it works for now, go with it...
	var m MetaContext

	link := randChainLink()
	c.Put(m, link.id, link)

	if c.Len() != 1 {
		t.Errorf("c.cache len: %d, expected 1", c.Len())
	}

	_, ok := c.Get(link.id)
	if !ok {
		t.Errorf("Get failed after Put")
	}

	for i := 0; i < 50; i++ {
		nlink := randChainLink()
		c.Put(m, nlink.id, nlink)
	}

	// get the first inserted one to make it LRU
	_, ok = c.Get(link.id)
	if !ok {
		t.Errorf("Get failed after Put of 50")
	}

	if c.Len() != 51 {
		t.Errorf("c.cache len: %d, expected 51", c.Len())
	}

	c.Clean()

	if c.Len() != 10 {
		t.Errorf("c.cache len: %d, expected 10", c.Len())
	}

	// the first inserted link should still be there
	_, ok = c.Get(link.id)
	if !ok {
		t.Errorf("expected first link to be cached")
	}
}