void () { myFixture.configureByFile(getTestName(true) + ".java"); new ListTemplatesHandler().invoke(myFixture.getProject(), myFixture.getEditor(), myFixture.getFile()); LookupElement[] elements = myFixture.getLookupElements(); assertNotNull(elements); LookupElement targetElement = null; for (LookupElement element : elements) { if (element.getLookupString().equals(".not")) { targetElement = element; } } assertNotNull(targetElement); myFixture.getLookup().setCurrentItem(targetElement); myFixture.finishLookup(Lookup.NORMAL_SELECT_CHAR); myFixture.checkResultByFile(getTestName(true) + "_after.java"); }