private static boolean isMetricPresent(SpringXDTemplate xdTemplate, String name) {
		boolean result = false;
		PagedResources<MetricResource> resources = xdTemplate.counterOperations().list();
		Iterator<MetricResource> resourceIter = resources.iterator();
		while (resourceIter.hasNext()) {
			MetricResource resource = resourceIter.next();
			if (name.equals(resource.getName())) {
				result = true;
				break;
			}
		}
		return result;
	}
Create an new instance of the SpringXDTemplate given the Admin Server URL

@param adminServer URL of the Admin Server
@return A new instance of SpringXDTemplate
spring-xd-integration-test/src/main/java/org/springframework/xd/integration/util/StreamUtils.java