protected M getOrCreate(String name) {
		synchronized (map) {
			M result = findOne(name);
			if (result == null) {
				result = create(name);
				result = save(result);
			}
			return result;
		}
	}
Memory backed implementation of MetricRepository that uses a ConcurrentMap

@author Luke Taylor
spring-xd-analytics/src/main/java/org/springframework/xd/analytics/metrics/memory/InMemoryMetricRepository.java