code: private static int getInstanceCounter(String name){
  		AtomicInteger counter = instanceCounters.get(name);
  		if (counter!=null)
  			return counter.incrementAndGet();
  
  		counter = new AtomicInteger(0);
  		AtomicInteger old = instanceCounters.putIfAbsent(name, counter);
  		if (old!=null)
  			counter = old;
  		return counter.incrementAndGet();
  	}
docs: Returns a new counter for instance with core-name 'name'. We support multiple producers with same name by adding a minus <number> to the name, like Service, Service-1 etc.
  @param name proposed name of the instance.
  @return instance count for known instances with name 'name'.