void () { FileTemplate template = FileTemplateManager.getInstance(getProject()).getCodeTemplate(JavaTemplateUtil.TEMPLATE_CATCH_BODY); String old = template.getText(); template.setText("// ${DS} \n" + "${EXCEPTION}.printStackTrace();"); try { doTest(new JavaWithTryCatchSurrounder()); } finally { template.setText(old); } }