public static List<MetricsPublisher> getMetricsPublishers(
			List<JavaInformations> javaInformationsList) {
		assert javaInformationsList != null && !javaInformationsList.isEmpty();
		final StringBuilder sb = new StringBuilder();
		for (final JavaInformations javaInformations : javaInformationsList) {
			if (sb.length() != 0) {
				sb.append('_');
			}
			sb.append(javaInformations.getHost().replaceFirst("@.*", ""));
		}
		String contextPath = Parameter.APPLICATION_NAME.getValue();
		if (contextPath == null) {
			contextPath = javaInformationsList.get(0).getContextPath();
		}
		if (contextPath == null) {
			// for NodesCollector in Jenkins, contextPath is null
			contextPath = "NA";
		} else if (contextPath.isEmpty()) {
			// for CloudWatch, InfluxDB, Datadog, a tag/dimension is not supposed to be empty
			contextPath = "/";
		}
		final String hosts = sb.toString();
		return getMetricsPublishers(contextPath, hosts);
	}
@Test
	public void test() {
		final List<JavaInformations> javaInformationsList = new ArrayList<>();
		javaInformationsList.add(new JavaInformations(null, false));
		javaInformationsList.add(new JavaInformations(null, false));
		assertEquals("getMetricsPublishers", 0,
				MetricsPublisher.getMetricsPublishers(javaInformationsList).size());
		setProperty(Parameter.GRAPHITE_ADDRESS, "localhost:2003");
		setProperty(Parameter.STATSD_ADDRESS, "localhost:8125");
		setProperty(Parameter.CLOUDWATCH_NAMESPACE, "MyCompany/MyAppDomain");
		System.setProperty("aws.region", "us-west-1");
		setProperty(Parameter.INFLUXDB_URL, "http://localhost:8086/write?db=mydb");
		setProperty(Parameter.DATADOG_API_KEY, "9775a026f1ca7d1c6c5af9d94d9595a4");
		assertEquals("getMetricsPublishers", 5,
				MetricsPublisher.getMetricsPublishers(javaInformationsList).size());
	}