void () { Project project = getProject(); // don't use method references here to make stack trace reading easier //noinspection Convert2MethodRef new RunAll( () -> { if (project != null) { CodeStyle.dropTemporarySettings(project); } }, () -> { if (myCodeStyleSettingsTracker != null) { myCodeStyleSettingsTracker.checkForSettingsDamage(); } }, () -> { if (project != null) { TestApplicationManager.waitForProjectLeakingThreads(project); } }, () -> super.tearDown(), // call all disposables' dispose() while the project is still open () -> { myProject = null; myModule = null; if (project != null) { TestApplicationManager.tearDownProjectAndApp(project); } }, () -> LightPlatformTestCase.checkEditorsReleased(), () -> Disposer.dispose(mySdkParentDisposable), () -> { SdkLeakTracker oldSdks = myOldSdks; if (oldSdks != null) { oldSdks.checkForJdkTableLeaks(); } }, () -> { if (project != null) { InjectedLanguageManagerImpl.checkInjectorsAreDisposed(project); } }, () -> { Application app = ApplicationManager.getApplication(); if (app != null) { TestApplicationKt.clearIdCache(app); } }, () -> HeavyPlatformTestCase.cleanupApplicationCaches(project) ).run(); }