@Test
public void should_capture_name_of_method_called() throws Exception {

    final Instrumentation inst = ByteBuddyAgent.install();
    final ByteBuddy bb = new ByteBuddy();
    final P2<Gather.Exports, Gather.Transforms> pair =
            List.iterableList(TypeDescription.ForLoadedType.of(Foo.class).getDeclaredMethods())
                .foldLeft(Main.gather(bb, new MockComp()), P.p(c -> TreeMap.empty(Ord.stringOrd), c -> r -> a -> a));
    final Config config = ConfigFactory.empty();
    pair._2()
        .f(config)
        .f(k -> pair._1().f(config).get().f(k).some())
        .f(new AgentBuilder.Default(bb).with(Main.LoggerListener.DEFAULT)).installOn(inst);
    final Class<?> bar = getClass().getClassLoader().loadClass("ji.core.MainTest$Bar");
    bar.getDeclaredMethod("baz", String.class).invoke(null, "123");
    assertThat(Foo.ref().get(), is("baz"));
}