code: public static String getFactoryName(String type,
  			ConfigurableListableBeanFactory beanFactory) {
  		String[] factoryNames = BeanFactoryUtils.beanNamesForTypeIncludingAncestors(
  				beanFactory, EnvironmentRepositoryFactory.class, true, false);
  		return Arrays.stream(factoryNames).filter(n -> n.startsWith(type)).findFirst()
  				.orElse(null);
  	}
docs: Given a type of EnvironmentRepository (git, svn, native, etc...) returns the name
  of the factory bean. See {@link #getCompositeTypeList(Environment)}
  @param type type of a repository
  @param beanFactory Spring Bean Factory
  @return name of the factory bean