void () { myFixture.configureByText("A.java", """ class A {void f(String[] elements){ String element = "hello"; for (String el<caret>ement : elements){}}}"""); IntentionAction intention = myFixture.findSingleIntention(QuickFixBundle.message("navigate.variable.declaration.text", "element")); assertNotNull(intention); myFixture.launchAction(intention); NonBlockingReadActionImpl.waitForAsyncTaskCompletion(); assertEquals(51, myFixture.getCaretOffset()); }