private void simulateDialogButtonClick(DialogControl dialog, ButtonType press) {
    Optional<Button> button = dialog.getButton(press);
    button.get().fire();
  }
Internal testing method that will simulate a click on the {@link Button} of
{@link ButtonType} of the {@code dialog}.

@param dialog of which the button is to be pressed
@param press the {@link ButtonType} of the {@link Button} that should be pressed
workbenchfx-core/src/test/java/com/dlsc/workbenchfx/WorkbenchTest.java