void (@NotNull Project project) { if (ApplicationManager.getApplication().isUnitTestMode()) return; List<PsiFile> psiFiles = new ArrayList<>(); for (VirtualFile file : FileEditorManager.getInstance(project).getOpenFiles()) { if (!isToBeDeletedOnClose(file)) continue; ContainerUtil.addIfNotNull(psiFiles, PsiManager.getInstance(project).findFile(file)); } if (!psiFiles.isEmpty()) { DeleteHandler.deletePsiElement(PsiUtilCore.toPsiElementArray(psiFiles), project, false); } }