void () { Editor e = createSaveAndOpenFile("x/BeanContextServicesSupport.java", "package x;\n" + "public class BeanContextServicesSupport {" + " protected class BCSSChild {" + " class BCSSCServiceClassRef {" + " void addRequestor(Object requestor) {" + " }" + " }" + " }" + "}"); Editor e2 = createSaveAndOpenFile("x/Component.java", "package x;\n" + "public class Component {" + " protected class FlipBufferStrategy {" + " protected int numBuffers;" + " protected void createBuffers(int numBuffers){}" + " }" + "}"); try { UIUtil.dispatchAllInvocationEvents(); PsiDocumentManager.getInstance(getProject()).commitAllDocuments(); doTest(false); } finally { PsiDocumentManager.getInstance(getProject()).commitAllDocuments(); VirtualFile file = Objects.requireNonNull(FileDocumentManager.getInstance().getFile(e.getDocument())); FileEditorManager.getInstance(getProject()).closeFile(file); VfsTestUtil.deleteFile(file); VirtualFile file2 = Objects.requireNonNull(FileDocumentManager.getInstance().getFile(e2.getDocument())); FileEditorManager.getInstance(getProject()).closeFile(file2); VfsTestUtil.deleteFile(file2); } }