private DialogControl getShowingDialogControl() {
    if (workbench.getNonBlockingOverlaysShown().size() == 1) {
      return (DialogControl) workbench.getNonBlockingOverlaysShown().stream().findAny().get();
    } else if (workbench.getBlockingOverlaysShown().size() == 1) {
      return (DialogControl) workbench.getBlockingOverlaysShown().stream().findAny().get();
    }
    return null;
  }
Internal testing method which returns the currently shown DialogControl.
workbenchfx-core/src/test/java/com/dlsc/workbenchfx/WorkbenchTest.java