void () { final FileEditorManager editorManager = FileEditorManager.getInstance(getProject()); try { PlatformTestUtil.startPerformanceTest("xml formatter", 10000, createTestRunnable()).useLegacyScaling().assertTiming(); } finally { final VirtualFile[] selectedFiles = editorManager.getSelectedFiles(); for (VirtualFile selectedFile : selectedFiles) { editorManager.closeFile(selectedFile); } } }