code: private <T extends Assignable> T createExtension(Class<T> extensionImplClass, Archive<?> archive) {
  
          T extension;
          Constructor<T> extensionImplConstructor = findConstructor(extensionImplClass);
  
          @SuppressWarnings("unchecked")
          Class<T> constructorArg = (Class<T>) extensionImplConstructor.getParameterTypes()[0];
          try {
  
              if (constructorArg.isInstance(archive)) {
                  extension = extensionImplConstructor.newInstance(archive);
              } else {
                  extension = extensionImplConstructor.newInstance(load(constructorArg, archive));
              }
          } catch (InstantiationException e) {
              throw new ExtensionLoadingException("Failed to instantiate class of type " + archive.getClass()
                  + ". The underlying class can not be abstract.", e);
          } catch (IllegalAccessException e) {
              throw new ExtensionLoadingException("Failed to instantiate class of type " + archive.getClass()
                  + ". The underlying constructor is inaccessible.", e);
          } catch (InvocationTargetException e) {
              throw new ExtensionLoadingException("Failed to instantiate class of type " + archive.getClass()
                  + ". The underlying constructor threw an exception.", e);
          }
  
          return extension;
      }
docs: Creates an instance of <code>extensionImplClass</code> using <code>archive</code> as the parameter for its
  one-argument list constructor.
  
  @param <T>
  @param extensionImplClass
  @param archive
  @return