void (String actual, String expected) { myFixture.configureByText("a.sh", actual); final Editor editor = myFixture.getEditor(); final Project project = editor.getProject(); assertNotNull(project); new ListTemplatesAction().actionPerformedImpl(project, editor); final LookupImpl lookup = (LookupImpl) LookupManager.getActiveLookup(editor); assertNotNull(lookup); lookup.finishLookup(Lookup.NORMAL_SELECT_CHAR); TemplateState template = TemplateManagerImpl.getTemplateState(editor); if (template != null) { Disposer.dispose(template); } myFixture.checkResult(expected); }