private void assertDialogShown(WorkbenchDialog result, boolean blocking) {
    verify(result).getDialogControl();
    assertSame(mockDialog, result);
    assertSame(1, workbench.getOverlays().size());
    assertSame(dialogControl, workbench.getOverlays().keySet().stream().findAny().get());
    assertSame(workbench, dialogControl.getWorkbench());
    if (blocking) {
      assertSame(1, workbench.getBlockingOverlaysShown().size());
      assertSame(0, workbench.getNonBlockingOverlaysShown().size());
    } else {
      assertSame(0, workbench.getBlockingOverlaysShown().size());
      assertSame(1, workbench.getNonBlockingOverlaysShown().size());
    }
  }
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