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: broker_test.go
    path of file: ./repos/inbucket/pkg/extension
    
    the code of the file until where you have to start completion: package extension_test

import (
	"testing"

	"github.com/inbucket/inbucket/v3/pkg/extension"
)

func TestBrokerEmitCallsOneListener(t *testing.T) {
	broker := &extension.EventBroker[string, bool]{}

	// Setup listener.
	var got string
	listener := func(s string) *bool {
		got = s
		ret
    
func TestBrokerEmitCapturesFirstResult(t *testing.T) {
	broker := &extension.EventBroker[struct{}, string]{}

	// Setup listeners.
	makeListener := func(result *string) func(struct{}) *string {
		return func(s struct{}) *string { return result }
	}
	first := "first"
	second := "second"
	broker.AddListener("0", makeListener(nil))
	broker.AddListener("1", makeListener(&first))
	broker.AddListener("2", makeListener(&second))

	want := first
	got := broker.Emit(&struct{}{})
	if got == nil {
		t.Errorf("Emit got nil, want %q", want)
	} else if *got != want {
		t.Errorf("Emit got %q, want %q", *got, want)
	}
}