public static void premain(String args, Instrumentation instrumentation) {
        new AgentBuilder.Default()
                .type(ElementMatchers.isSubTypeOf(ScenarioBase.class))
                .transform((builder, type, classLoader, module) ->
                        builder.method(ElementMatchers.named("initialize")
                                .or(ElementMatchers.named("finished")))
                                .intercept(MethodDelegation.to(ManageTimerInterceptor.class))
                ).installOn(instrumentation);
    }
The method implementing the code injection done by Java Agents.
jgiven-timing/src/main/java/com/tngtech/jgiven/timing/TimerInjectorAgent.java