void (long timeout, @NotNull TimeUnit timeUnit) { EdtTestUtil.runInEdtAndWait(() -> { Application app = ApplicationManager.getApplication(); if (app != null && !app.isDisposed()) { TestApplicationKt.waitForAppLeakingThreads(app, timeout, timeUnit); } }); }