@SuppressWarnings("unchecked")
private <T extends IComponent> T createComponentInstance(
Class<T> componentContract, Object delegate, Class<?>[] extraInterfaces) {
IComponentDescriptor<IComponent> componentDescriptor = (IComponentDescriptor<IComponent>) componentDescriptorRegistry
.getComponentDescriptor(componentContract);
InvocationHandler componentHandler;
if (delegate != null) {
componentHandler = createDelegatingComponentInvocationHandler(
componentDescriptor, delegate);
} else {
componentHandler = createComponentInvocationHandler(componentDescriptor);