private static void instrumentMaven(Instrumentation instrumentation) {
        try {
            for (Class<?> clz : instrumentation.getAllLoadedClasses()) {
                String name = clz.getName();
                if (name.equals(Names.ABSTRACT_SUREFIRE_MOJO_CLASS_VM)
                        || name.equals(Names.SUREFIRE_PLUGIN_VM)
                        || name.equals(Names.FAILSAFE_PLUGIN_VM)
                        || name.equals(Names.TESTMOJO_VM)) {
                    instrumentation.retransformClasses(clz);
                }
            }
        } catch (UnmodifiableClassException ex) {
            // Consider something better than doing nothing.
        }
    }
private static void instrumentMaven ( Instrumentation instrumentation ) { try { for ( Class < ? > clz : instrumentation . getAllLoadedClasses ( ) ) { String name = clz . getName ( ) ; if ( name . equals ( Names . ABSTRACT_SUREFIRE_MOJO_CLASS_VM ) || name . equals ( Names . SUREFIRE_PLUGIN_VM ) || name . equals ( Names . FAILSAFE_PLUGIN_VM ) || name . equals ( Names . TESTMOJO_VM ) ) { instrumentation . retransformClasses ( clz ) ; } } } catch ( UnmodifiableClassException ex ) { } }
Instrument Surefire classes if they are loaded. This may be
needed if class has been loaded before a surefire is started
(e.g., used by another module that does not use Ekstazi).

This code should be in another class/place.