Watch this screencast to see how the JetBrains MPS plugin for IntelliJ IDEA can optimize tail-recursive Java methods and functions.
Note: You may also like to check out the Memoization for Java screencast.
MPS languages inside IntelliJ IDEA - a parallel for loop example