I think you would have to use a CodeIterator to go over the code one instruction at a time and compare them. You need to make sure that the instructions are the same, and also that the value of any items that they point to in the const pool is also the same. A complete list of the bytecode instructions can be found at:
Thankyou very much for pointing me in the right direction. I managed to find InstructionPrinter which gave me a template to follow for extra info comparison. It works perfectly now.