long (boolean checkWarnings, boolean checkInfos, boolean checkWeakWarnings, @NotNull Stream<? extends VirtualFile> files) { record FileHighlighting(PsiFile file, Editor editor, ExpectedHighlightingData data) {} List<FileHighlighting> data = files.map(file -> { PsiFile psiFile = myPsiManager.findFile(file); assertNotNull(psiFile); Document document = PsiDocumentManager.getInstance(getProject()).getDocument(psiFile); assertNotNull(document); ExpectedHighlightingData datum = new ExpectedHighlightingData(document, checkWarnings, checkWeakWarnings, checkInfos, false); datum.init(); return new FileHighlighting(psiFile, createEditor(file), datum); }).toList(); long elapsed = 0; for (FileHighlighting highlighting : data) { setFileAndEditor(highlighting.file().getVirtualFile(), highlighting.editor()); elapsed += collectAndCheckHighlighting(highlighting.data()); } return elapsed; }