void (TestDialog newValue) { try { // TestDialogManager.setTestDialog(newValue); IntelliJ>=2020.3 callPerReflection("com.intellij.openapi.ui.TestDialogManager", newValue); } catch (Exception ignore) { try { // Messages.setTestDialog(newValue); IntelliJ<=2020.2 callPerReflection("com.intellij.openapi.ui.Messages", newValue); } catch (Exception ignore2) { fail("No supported DialogManager classes found!"); } } }