@Test
  @DisplayName("Show non-blocking dialog and close by clicking on the GlassPane")
  void showDialogNonBlockingCloseGlassPaneDefault() {
    robot.interact(() -> {
      assertDialogNotShown();

      WorkbenchDialog result = workbench.showDialog(mockDialog);

      assertDialogShown(result, false);
      verify(mockDialog, atLeastOnce()).getButtonTypes();
      verify(mockOnResult, never()).accept(any()); // no result yet

      // hiding by GlassPane click
      simulateGlassPaneClick(dialogControl);

      verify(mockOnResult).accept(ButtonType.CANCEL);
      assertDialogNotShown();
    });
  }
Internal utility method for testing.
Simulates closing the stage, which fires a close request to test logic
inside of {@link Stage#setOnCloseRequest(EventHandler)}.
Using {@link FxRobot#closeCurrentWindow()} would be better, but it only works on Windows
because of its implementation, so this approach was chosen as a workaround.
@see <a href="https://github.com/TestFX/TestFX/issues/447">
closeCurrentWindow() doesn't work headless</a>
workbenchfx-core/src/test/java/com/dlsc/workbenchfx/WorkbenchTest.java