void () { // don't use method references here to make stack trace reading easier //noinspection Convert2MethodRef RunAll.runAll( () -> EDT.dispatchAllInvocationEvents(), () -> { // getAllEditors() should be called only after dispatchAllInvocationEvents(), that's why separate RunAll is used Application app = ApplicationManager.getApplication(); if (app != null) { TestApplicationKt.checkEditorsReleased(app); } }); }