void addImportedServiceModel(List<ImportedServiceModel> serviceModels) {
    try {
      String id = identity;
      if (id == null) {
        id = generateId(serviceModels, serviceType);
      }

      ImportedServiceModel serviceModel =
          new ImportedServiceModel(
              serviceType,
              visibility,
              serviceProvider,
              id,
              new MetaInfo(metaInfo).withAnnotations(serviceType),
              moduleAssembly.name());
      serviceModels.add(serviceModel);
    } catch (Exception e) {
      throw new InvalidApplicationException("Could not register " + serviceType.getName(), e);
    }
  }
  @SuppressWarnings({"raw", "unchecked"})
  void addImportedServiceModel(List<ImportedServiceModel> serviceModels) {
    try {
      String id = identity;
      if (id == null) {
        id = generateId(serviceModels, serviceType);
      }

      ImportedServiceModel serviceModel =
          new ImportedServiceModel(
              serviceType,
              visibility,
              serviceProvider,
              id,
              importOnStartup,
              new MetaInfo(metaInfo).withAnnotations(serviceType),
              new ActivatorsModel(activators),
              moduleAssembly.name());
      serviceModels.add(serviceModel);
    } catch (Exception e) {
      throw new InvalidApplicationException("Could not register " + serviceType.getName(), e);
    }
  }