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