@Bean(destroyMethod = "shutdown")
		@ConditionalOnMissingBean(value = EurekaClient.class, search = SearchStrategy.CURRENT)
		public EurekaClient eurekaClient(ApplicationInfoManager manager, EurekaClientConfig config,
				TransportClientFactories<?> transportClientFactories, ApplicationContext context,
				AbstractDiscoveryClientOptionalArgs optionalArgs) {
			return new CloudEurekaClient(manager, config, transportClientFactories, optionalArgs, context) {
				@Override
				public synchronized void shutdown() {
					CountDownLatch latch = countDownLatch();
					if (latch.getCount() == 1) {
						latch.countDown();
					}
					super.shutdown();
				}
			};
		}
@author Spencer Gibb
@author Matt Jenkins
@author Olga Maciaszek-Sharma
@author Tim Ysewyn
spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/EurekaClientAutoConfigurationTests.java