}
public static void expandTemplate(final Editor editor) {
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) {