List<Annotation> (@NotNull Annotator annotator, @NotNull PsiElement @NotNull... elements) { PsiFile psiFile = elements[0].getContainingFile(); return AnnotationSessionImpl.computeWithSession(psiFile, false, annotationHolder -> { for (PsiElement element : elements) { annotationHolder.runAnnotatorWithContext(element, annotator); } annotationHolder.assertAllAnnotationsCreated(); return List.copyOf(annotationHolder); }); }