void () { boolean previous = myGlobalTool.ignoreWhenRefactoringIsComplicated; try { myGlobalTool.ignoreWhenRefactoringIsComplicated = false; doTest(getGlobalTestDir(), myTool); } finally { myGlobalTool.ignoreWhenRefactoringIsComplicated = previous; } }