public <T> T createProxy(Class<T> targetClass, T target) {
    return PerfStatsCollector.getInstance()
        .measure(
            "createProxyInstance",
            () -> factories.get(targetClass).createProxy(targetClass, target));
  }
@Test
  public void cachesProxyClass() {
    ProxyMaker maker = new ProxyMaker(IDENTITY_NAME);
    Thing thing1 = mock(Thing.class);
    Thing thing2 = mock(Thing.class);

    Thing proxy1 = maker.createProxy(Thing.class, thing1);
    Thing proxy2 = maker.createProxy(Thing.class, thing2);

    assertThat(proxy1.getClass()).isSameInstanceAs(proxy2.getClass());
  }