class KubernetesClientInformerSelectiveNamespacesAutoConfiguration {

	private static final LogAccessor LOG = new LogAccessor(
			LogFactory.getLog(KubernetesClientInformerSelectiveNamespacesAutoConfiguration.class));

	// we rely on the order of namespaces to enable listers, as such provide a bean of
	// namespaces as a list, instead of the incoming Set.
	@Bean
	public List<String> selectiveNamespaces(KubernetesDiscoveryProperties properties) {
		List<String> selectiveNamespaces = properties.namespaces().stream().sorted().toList();
		LOG.debug(() -> "using selective namespaces : " + selectiveNamespaces);
		return selectiveNamespaces;
	}

	@Bean
	@ConditionalOnMissingBean(value = SharedInformerFactory.class, parameterizedContainer = List.class)
	public List<SharedInformerFactory> sharedInformerFactories(ApiClient apiClient, List<String> selectiveNamespaces) {<FILL_FUNCTION_BODY>}

	@Bean
	@ConditionalOnMissingBean(value = V1Service.class,
			parameterizedContainer = { List.class, SharedIndexInformer.class })
	public List<SharedIndexInformer<V1Service>> serviceSharedIndexInformers(
			List<SharedInformerFactory> sharedInformerFactories, List<String> selectiveNamespaces,
			ApiClient apiClient) {

		int howManyNamespaces = selectiveNamespaces.size();
		List<SharedIndexInformer<V1Service>> serviceSharedIndexedInformers = new ArrayList<>(howManyNamespaces);
		for (int i = 0; i < howManyNamespaces; ++i) {
			GenericKubernetesApi<V1Service, V1ServiceList> servicesApi = new GenericKubernetesApi<>(V1Service.class,
					V1ServiceList.class, "", "v1", "services", apiClient);
			SharedIndexInformer<V1Service> sharedIndexInformer = sharedInformerFactories.get(i)
					.sharedIndexInformerFor(servicesApi, V1Service.class, 0L, selectiveNamespaces.get(i));
			serviceSharedIndexedInformers.add(sharedIndexInformer);
		}
		return serviceSharedIndexedInformers;
	}

	@Bean
	@ConditionalOnMissingBean(value = V1Service.class, parameterizedContainer = { List.class, Lister.class })
	public List<Lister<V1Service>> serviceListers(List<String> selectiveNamespaces,
			List<SharedIndexInformer<V1Service>> serviceSharedIndexInformers) {

		int howManyNamespaces = selectiveNamespaces.size();
		List<Lister<V1Service>> serviceListers = new ArrayList<>(howManyNamespaces);

		for (int i = 0; i < howManyNamespaces; ++i) {
			String namespace = selectiveNamespaces.get(i);
			Lister<V1Service> lister = new Lister<>(serviceSharedIndexInformers.get(i).getIndexer(), namespace);
			LOG.debug(() -> "registering lister (for services) in namespace : " + namespace);
			serviceListers.add(lister);
		}

		return serviceListers;
	}

	@Bean
	@ConditionalOnMissingBean(value = V1Endpoints.class,
			parameterizedContainer = { List.class, SharedIndexInformer.class })
	public List<SharedIndexInformer<V1Endpoints>> endpointsSharedIndexInformers(
			List<SharedInformerFactory> sharedInformerFactories, List<String> selectiveNamespaces,
			ApiClient apiClient) {

		int howManyNamespaces = selectiveNamespaces.size();
		List<SharedIndexInformer<V1Endpoints>> endpointsSharedIndexedInformers = new ArrayList<>(howManyNamespaces);
		for (int i = 0; i < howManyNamespaces; ++i) {
			GenericKubernetesApi<V1Endpoints, V1EndpointsList> endpointsApi = new GenericKubernetesApi<>(
					V1Endpoints.class, V1EndpointsList.class, "", "v1", "endpoints", apiClient);
			SharedIndexInformer<V1Endpoints> sharedIndexInformer = sharedInformerFactories.get(i)
					.sharedIndexInformerFor(endpointsApi, V1Endpoints.class, 0L, selectiveNamespaces.get(i));
			endpointsSharedIndexedInformers.add(sharedIndexInformer);
		}
		return endpointsSharedIndexedInformers;
	}

	@Bean
	@ConditionalOnMissingBean(value = V1Endpoints.class, parameterizedContainer = { List.class, Lister.class })
	public List<Lister<V1Endpoints>> endpointsListers(List<String> selectiveNamespaces,
			List<SharedIndexInformer<V1Endpoints>> serviceSharedIndexInformers) {

		int howManyNamespaces = selectiveNamespaces.size();
		List<Lister<V1Endpoints>> endpointsListers = new ArrayList<>(howManyNamespaces);

		for (int i = 0; i < howManyNamespaces; ++i) {
			String namespace = selectiveNamespaces.get(i);
			Lister<V1Endpoints> lister = new Lister<>(serviceSharedIndexInformers.get(i).getIndexer());
			LOG.debug(() -> "registering lister (for endpoints) in namespace : " + namespace);
			endpointsListers.add(lister);
		}

		return endpointsListers;
	}

}


		int howManyNamespaces = selectiveNamespaces.size();
		List<SharedInformerFactory> sharedInformerFactories = new ArrayList<>(howManyNamespaces);
		for (int i = 0; i < howManyNamespaces; ++i) {
			sharedInformerFactories.add(new SharedInformerFactory(apiClient));
		}
		return sharedInformerFactories;
	
<no_super_class>