void () { Project project = getProject(); VirtualFile file = JavaCodeFragmentFactory.getInstance(project).createExpressionCodeFragment("a", null, null, true).getViewProvider().getVirtualFile(); assertInstanceOf(file, LightVirtualFile.class); GCUtil.tryGcSoftlyReachableObjects(); assertInstanceOf(PsiManager.getInstance(project).findFile(file), PsiExpressionCodeFragment.class); }