I a sure you have come to this article to find a solution o the maddening error: Caused by: java.lang.UnsupportedOperationException: adding retransformable transformers is not supported in this environment while calling Instrumentation.addTransformer(transformer, true).
Are you using Lambda expressions in Java? If not, you should start looking at them now for they are very powerful and reduce code clutter. The syntax is similar to Groovy and easy to learn. It allows you to embed an expression or method as an argument to another method, without requiring you to cumbersome inner classes. Here is an example: