void (@NotNull String lookupText) { myFixture.configureByFile(getTestName(false) + ".java"); new ListTemplatesAction().actionPerformedImpl(myFixture.getProject(), myFixture.getEditor()); LookupElement[] elements = myFixture.getLookupElements(); assertNotNull(elements); for (LookupElement element : elements) { if (lookupText.equals(element.getLookupString())) { myFixture.getLookup().setCurrentItem(element); myFixture.finishLookup(Lookup.NORMAL_SELECT_CHAR); myFixture.checkResultByFile(getTestName(false) + "_after.java"); return; } } //noinspection ConstantConditions fail("Lookup element with text '" + lookupText + "' not found:\n" + StringUtil.join(myFixture.getLookupElementStrings(), "\n")); }