void (@NotNull ModalityState modalityState, @NotNull Condition<?> expired, @NotNull Runnable runnable) { Application app = ApplicationManager.getApplication(); if (app.isDispatchThread()) { runnable.run(); } else { app.invokeLater(runnable, modalityState, expired); } }