void () { FileTemplate template = FileTemplateManager.getInstance(getProject()).getCodeTemplate(JavaTemplateUtil.TEMPLATE_CATCH_DECLARATION); String old = template.getText(); template.setText("final ${EXCEPTION_TYPE} ex"); try { doTest(new JavaWithTryCatchSurrounder()); } finally { template.setText(old); } }