testCreateAttachTarget() {
    // Randomly picking parameters.
    const targetCorner = Corner.TOP_END;
    const menuCorner = Corner.BOTTOM_LEFT;
    const contextMenu = false;  // Show menu on mouse down event.
    const margin = new Box(0, 10, 5, 25);

    // Simply setting the required parameters.
    /** @suppress {visibility} suppression added to enable type checking */
    let target = popup.createAttachTarget(anchor);
    assertTrue(popup.isAttachTarget(anchor));
    assertTarget(
        target, anchor, undefined, undefined, EventType.MOUSEDOWN, undefined);

    // Creating another target with all the parameters.
    /** @suppress {visibility} suppression added to enable type checking */
    target = popup.createAttachTarget(
        anchor, targetCorner, menuCorner, contextMenu, margin);
    assertTrue(popup.isAttachTarget(anchor));
    assertTarget(
        target, anchor, targetCorner, menuCorner, EventType.MOUSEDOWN, margin);

    // Finally, switch up the 'contextMenu'
    /** @suppress {visibility} suppression added to enable type checking */
    target = popup.createAttachTarget(
        anchor, undefined, undefined, true /*opt_contextMenu*/, undefined);
    assertTarget(
        target, anchor, undefined, undefined, EventType.CONTEXTMENU, undefined);
  }
Tests the behavior of {@link PopupMenu.createAttachTarget}.
     @suppress {visibility,checkTypes} suppression added to enable type checking