void () { @SuppressWarnings("ALL") @Language("JAVA") String fileText = "public class Fix {\n" + " {\n" + " Fix ff = getFix();\n" + " ff.<caret>toString();\n" + " }\n" + " \n" + " Fix getFix() {return new FixImpl1();}\n" + "}\n" + "class FixImpl1 extends Fix {\n" + " @Override\n" + " public String toString() {\n" + " return \"Impl1\";\n" + " }\n" + "}\n" + "class FixImpl2 extends Fix {\n" + " @Override\n" + " public String toString() {\n" + " return \"Impl2\";\n" + " }\n" + "}"; final PsiFile file = myFixture.addFileToProject("Foo.java", fileText); myFixture.configureFromExistingVirtualFile(file.getVirtualFile()); PlatformTestUtil.startPerformanceTest(getTestName(false), 150, () -> { PsiElement[] impls = getTargets(file); assertEquals(3, impls.length); }).usesAllCPUCores().assertTiming(); }