### Question:
CachingProxyFactory implements IProxyFactory { @Override public Class<?> createClass(Class<?> clazz) { return getFactory().createClass(clazz); } CachingProxyFactory(IProxyFactory factory); @Override Class<?> createClass(Class<?> clazz); @Override Object createInstance(final Class<?> proxyClass, final Callback callback); @Override Callback getCallback(Object proxy); void destroy(Application application);  }### Answer:
@Test public void test() throws Exception { final int[] count = new int[1]; IProxyFactory factory = new CachingProxyFactory(new IProxyFactory() { @Override public Callback getCallback(Object proxy) { return null; } @Override public Object createInstance(Class<?> proxyClass, Callback callback) { return null; } @Override public Class<?> createClass(Class<?> clazz) { count[0]++; return clazz; } }); factory.createClass(String.class); factory.createClass(String.class); assertEquals(1, count[0]); }