testGetAttachTarget() {
    popup.render();
    // Before the menu is attached to the anchor.
    /** @suppress {visibility} suppression added to enable type checking */
    let target = popup.getAttachTarget(anchor);
    assertTrue(
        'Not expecting a target before the element is attach to the menu',
        target == null);

    // 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);

    popup.attach(anchor, targetCorner, menuCorner, contextMenu, margin);
    /** @suppress {visibility} suppression added to enable type checking */
    target = popup.getAttachTarget(anchor);
    assertTrue(
        'Failed to get target after attaching element to menu', target != null);

    // Make sure we got the right target back.
    assertTarget(
        target, anchor, targetCorner, menuCorner, EventType.MOUSEDOWN, margin);
  }
Tests the behavior of {@link PopupMenu.getAttachTarget}.