BCEL. A tool to build classes on the fly and output them as bytecode. Complex stuff. Luckily it comes with BCELifier. This tool can take an existing .class file and generate the BCEL java source code to build that class. Very cool.
What this means is that if (like me) you find BCEL itself a mite tricky, you can write your class in the normal way, compile it, BCELify it and end up with the source code you need to feed BCEL with to get the same result. Groovy. This reminds me of my dim past, recording VBA macros in Excel to find out how to do something, then hacking the generated code into what I wanted.