func TestCacheableObject(t *testing.T) { … } type mockCreater … func (c *mockCreater) New(kind schema.GroupVersionKind) (runtime.Object, error) { … } type mockTyper … func (t *mockTyper) ObjectKinds(obj runtime.Object) ([]schema.GroupVersionKind, bool, error) { … } func (t *mockTyper) Recognizes(_ schema.GroupVersionKind) bool { … } func TestSerializerEncodeWithAllocator(t *testing.T) { … } func TestRawSerializerEncodeWithAllocator(t *testing.T) { … } type testAllocator … func (ta *testAllocator) Allocate(n uint64) []byte { … }