beanClasses.add(FooImpl.class);
startContainer(beanClasses, beanXmls);
final Bean<FooImpl> bean = getBean(FooImpl.class);
FooImpl instance = FooImpl.class.cast(getBeanManager().getReference(bean, FooImpl.class, null));
Assert.assertNotNull(instance);
instance.doSomething("test1");
// Ensure the method call was intercepted, and value was set
Assert.assertEquals(TestInterceptor1.invocationCount, 1);
Assert.assertEquals(instance.getValue(), "test1");
// Cast FooImpl to Foo, testing if the call becoming doSomething(Object)
// breaks the interception
Foo castInstance = (Foo) instance;
castInstance.doSomething("test2");
// Ensure the method call on to doSomethign(Object) was intercepted, and
// value was set
Assert.assertEquals(TestInterceptor1.invocationCount, 2);
Assert.assertEquals(instance.getValue(), "test2");
shutDownContainer();
}