Object foreignInstance = foreignType.newInstance();
List<?> proxy = (List<?>) foreignType.getMethod("getArrayList").invoke(foreignInstance);
Assert.assertFalse(Proxies.isForgeProxy(proxy));
Object delegate = foreignType.newInstance();
ArrayListFactory enhancedFactory = (ArrayListFactory) ClassLoaderAdapterBuilder.callingLoader(thisLoader)
.delegateLoader(dep1Loader).enhance(delegate);
Assert.assertTrue(Proxies.isForgeProxy(enhancedFactory));
@SuppressWarnings("rawtypes")
List enhancedInstance = enhancedFactory.getArrayList();
enhancedInstance.add(new ArrayListFactory());
enhancedInstance.get(0);
Assert.assertTrue(Proxies.isForgeProxy(enhancedInstance));
}