void (final Random random) { PsiClass aClass = getPsiClass(); switch (random.nextInt(4)) { case 0 -> { mark("v"); aClass.getContainingFile().accept(new PsiRecursiveElementVisitor() { }); } case 1 -> { mark("m"); for (int offset = 0; offset < myFile.getTextLength(); offset++) { myFile.findElementAt(offset); } } case 2 -> { mark("h"); aClass.accept(new PsiRecursiveElementVisitor() { @Override public void visitElement(@NotNull final PsiElement element) { super.visitElement(element); final HighlightInfoHolder infoHolder = new HighlightInfoHolder(myFile); for (HighlightVisitor visitor : HighlightVisitor.EP_HIGHLIGHT_VISITOR.getExtensionList(getProject())) { HighlightVisitor v = visitor.clone(); // to avoid race for com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.myAnnotationHolder v.analyze(myFile, true, infoHolder, () -> v.visit(element)); } } }); } case 3 -> { mark("u"); for (PsiMethod method : aClass.getMethods()) { method.getName(); } } } }