Frankly, I find avoiding duplicate code in Java to be a pain. I can't tell you how many times my perfectly sensible refactor has been tripped up by exception handling. I'd love to be able to pass around deferred bits of code. No such luck. In my database code, I seem to have a few sections of code that have identical try/catch blocks around them, but since the code on the inside of the try block is not the same, I can't seem to pull it out -- unless I wrap it in the try/catch blocks I'm trying to refactor. Am I just not getting the hang of software design in Java or is it always this bad?