Use byte code generation if Javassist is available.