void () { myFixture.configureByText("Test.java", """ class Test { public void test(int x) { if (x > 0) { String result = "positive"; } else if (x < 0) { re<caret> } } }"""); myFixture.completeBasic(); assertEquals("return", myFixture.getLookupElements()[0].getLookupString()); assertEquals("record", myFixture.getLookupElements()[1].getLookupString()); var element = myFixture.getLookupElements()[2]; assertEquals("result", element.getLookupString()); LookupElementPresentation presentation = renderElement(element); assertEquals(" (from if-then block)", presentation.getTailText()); selectItem(element); myFixture.checkResult(""" class Test { public void test(int x) { String result = null; if (x > 0) { result = "positive"; } else if (x < 0) { result } } }"""); }