/**
* Test if the component key is preserved if it is not a class type.
*/
public void testComponentKeyIsPreserved() {
final MutablePicoContainer mpc = new DefaultPicoContainer();
final ComponentAdapter componentAdapter = new CachingComponentAdapter(new ConstructorInjectionComponentAdapter(
"Touchy", CompatibleTouchable.class));
mpc.registerComponent(new AssimilatingComponentAdapter(Touchable.class, componentAdapter));
final CompatibleTouchable compatibleTouchable = (CompatibleTouchable) componentAdapter
.getComponentInstance(mpc);
final Touchable touchable = (Touchable) mpc.getComponentInstance("Touchy");
assertFalse(compatibleTouchable.wasTouched());
touchable.touch();
assertTrue(compatibleTouchable.wasTouched());