class EurekaConfigServerInstanceProvider {

	private final Log log;

	private final EurekaHttpClient client;

	private final EurekaClientConfig config;

	public EurekaConfigServerInstanceProvider(EurekaHttpClient client, EurekaClientConfig config) {
		this(LogFactory.getLog(EurekaConfigServerInstanceProvider.class), client, config);
	}

	public EurekaConfigServerInstanceProvider(Log log, EurekaHttpClient client, EurekaClientConfig config) {
		this.log = log;
		this.client = client;
		this.config = config;
	}

	public List<ServiceInstance> getInstances(String serviceId) {<FILL_FUNCTION_BODY>}

	private boolean isSuccessful(EurekaHttpResponse<Applications> response) {
		HttpStatus httpStatus = HttpStatus.resolve(response.getStatusCode());
		return httpStatus != null && httpStatus.is2xxSuccessful();
	}

}

		if (log.isDebugEnabled()) {
			log.debug("eurekaConfigServerInstanceProvider finding instances for " + serviceId);
		}
		String remoteRegionsStr = config.fetchRegistryForRemoteRegions();
		String[] remoteRegions = remoteRegionsStr == null ? null : remoteRegionsStr.split(",");
		EurekaHttpResponse<Applications> response = config.getRegistryRefreshSingleVipAddress() == null
				? client.getApplications(remoteRegions)
				: client.getVip(config.getRegistryRefreshSingleVipAddress(), remoteRegions);
		List<ServiceInstance> instances = new ArrayList<>();
		if (!isSuccessful(response) || response.getEntity() == null) {
			return instances;
		}

		Applications applications = response.getEntity();
		applications.shuffleInstances(config.shouldFilterOnlyUpInstances());
		List<InstanceInfo> infos = applications.getInstancesByVirtualHostName(serviceId);
		for (InstanceInfo info : infos) {
			instances.add(new EurekaServiceInstance(info));
		}
		if (log.isDebugEnabled()) {
			log.debug("eurekaConfigServerInstanceProvider found " + infos.size() + " instance(s) for " + serviceId
					+ ", " + instances);
		}
		return instances;
	
<no_super_class>