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: httpstream_test.go
    path of file: ./repos/kubernetes/staging/src/k8s.io/apimachinery/pkg/util/httpstream
    
    the code of the file until where you have to start completion: /*
Copyright 2015 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
    
func TestHandshake(t *testing.T) {
	tests := map[string]struct {
		clientProtocols  []string
		serverProtocols  []string
		expectedProtocol string
		expectError      bool
	}{
		"no common protocol": {
			clientProtocols:  []string{"c"},
			serverProtocols:  []string{"a", "b"},
			expectedProtocol: "",
			expectError:      true,
		},
		"no common protocol with comma separated list": {
			clientProtocols:  []string{"c, d"},
			serverProtocols:  []string{"a", "b"},
			expectedProtocol: "",
			expectError:      true,
		},
		"common protocol": {
			clientProtocols:  []string{"b"},
			serverProtocols:  []string{"a", "b"},
			expectedProtocol: "b",
		},
		"common protocol with comma separated list": {
			clientProtocols:  []string{"b, c"},
			serverProtocols:  []string{"a", "b"},
			expectedProtocol: "b",
		},
	}

	for name, test := range tests {
		req, err := http.NewRequest("GET", "http://www.example.com/", nil)
		if err != nil {
			t.Fatalf("%s: error creating request: %v", name, err)
		}

		for _, p := range test.clientProtocols {
			req.Header.Add(HeaderProtocolVersion, p)
		}

		w := newResponseWriter()
		negotiated, err := Handshake(req, w, test.serverProtocols)

		// verify negotiated protocol
		if e, a := test.expectedProtocol, negotiated; e != a {
			t.Errorf("%s: protocol: expected %q, got %q", name, e, a)
		}

		if test.expectError {
			if err == nil {
				t.Errorf("%s: expected error but did not get one", name)
			}
			if w.statusCode == nil {
				t.Errorf("%s: expected w.statusCode to be set", name)
			} else if e, a := http.StatusForbidden, *w.statusCode; e != a {
				t.Errorf("%s: w.statusCode: expected %d, got %d", name, e, a)
			}
			if e, a := test.serverProtocols, w.Header()[HeaderAcceptedProtocolVersions]; !reflect.DeepEqual(e, a) {
				t.Errorf("%s: accepted server protocols: expected %v, got %v", name, e, a)
			}
			continue
		}
		if !test.expectError && err != nil {
			t.Errorf("%s: unexpected error: %v", name, err)
			continue
		}
		if w.statusCode != nil {
			t.Errorf("%s: unexpected non-nil w.statusCode: %d", name, w.statusCode)
		}

		if len(test.expectedProtocol) == 0 {
			if len(w.Header()[HeaderProtocolVersion]) > 0 {
				t.Errorf("%s: unexpected protocol version response header: %s", name, w.Header()[HeaderProtocolVersion])
			}
			continue
		}

		// verify response headers
		if e, a := []string{test.expectedProtocol}, w.Header()[HeaderProtocolVersion]; !reflect.DeepEqual(e, a) {
			t.Errorf("%s: protocol response header: expected %v, got %v", name, e, a)
		}
	}
}