code: public static void register(BeanDefinitionRegistry registry,
  			Collection<String> packageNames) {
  		Assert.notNull(registry, "Registry must not be null");
  		Assert.notNull(packageNames, "PackageNames must not be null");
  		if (registry.containsBeanDefinition(BEAN)) {
  			BeanDefinition beanDefinition = registry.getBeanDefinition(BEAN);
  			ConstructorArgumentValues constructorArguments = beanDefinition
  					.getConstructorArgumentValues();
  			constructorArguments.addIndexedArgumentValue(0,
  					addPackageNames(constructorArguments, packageNames));
  		}
  		else {
  			GenericBeanDefinition beanDefinition = new GenericBeanDefinition();
  			beanDefinition.setBeanClass(EntityScanPackages.class);
  			beanDefinition.getConstructorArgumentValues().addIndexedArgumentValue(0,
  					StringUtils.toStringArray(packageNames));
  			beanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
  			registry.registerBeanDefinition(BEAN, beanDefinition);
  		}
  	}
docs: Register the specified entity scan packages with the system.
  @param registry the source registry
  @param packageNames the package names to register