{
Assert.fail("Should have received a " + ClassCastException.class.getName() + " but was: " + e);
}
Object delegate = foreignType.newInstance();
SimpleEnumFactory enhancedFactory = (SimpleEnumFactory) ClassLoaderAdapterBuilder.callingLoader(thisLoader)
.delegateLoader(dep1Loader).enhance(delegate);
Assert.assertTrue(Proxies.isForgeProxy(enhancedFactory));
SimpleEnum enhancedInstance = enhancedFactory.getEnum();
Assert.assertFalse(Proxies.isForgeProxy(enhancedInstance));
enhancedFactory.useEnum(SimpleEnum.STOPPED);
}