function mapChoicesToButtons(buttons, choices, modifier) {
    expect(buttons.length).toBe(choices.length);

    const map = new Map();

    // Find which choice corresponds to which button
    for (const choice of choices) {
      for (const button of buttons) {
        expect(button.childNodes.length).toBeGreaterThan(0);
        const uiOption = button.childNodes[0].textContent;
        const contentOption = modifier(choice);
        if (contentOption == uiOption) {
          map.set(choice, button);
        }
      }
    }

    return map;
  }
@param {!Array<!HTMLElement>} buttons
@param {!Array<string> | !Array<number>} choices
@param {function(string):string|function(number):string} modifier
@return {!Map<string, !HTMLElement> | !Map<number, !HTMLElement>}