@Test
	public void testMultiCountsInStream() {
		String afterGoodCounterName = "aftergoodcn" + UUID.randomUUID().toString();
		String goodAndBadCounterName = "goodandbadcn" + UUID.randomUUID().toString();

		String afterGoodLabelName = "aftergood";
		String goodAndBadLabelName = "goodandbad";

		stream(streamName, sources.http() + XD_DELIMITER +
				" good: filter --expression=#jsonPath(payload,'$.entities.hashtags[*]." +
				"text').contains('good') " + XD_DELIMITER +
				afterGoodLabelName + ": filter --expression=true " + XD_DELIMITER +
				"bad: filter --expression=#jsonPath(payload,'$." +
				"entities.hashtags[*].text').contains('bad') " + XD_DELIMITER +
				goodAndBadLabelName + ": splitter --expression=#jsonPath(payload,'$.id') "
				+ XD_DELIMITER + sinks.file());

		stream("tpaftergood", sources.tap(streamName).label(afterGoodLabelName) +
				XD_TAP_DELIMITER + sinks.counterSink(afterGoodCounterName));
		stream("tpgoodbad", sources.tap(streamName).
				label(goodAndBadLabelName) + XD_TAP_DELIMITER +
				sinks.counterSink(goodAndBadCounterName));

		sources.httpSource(streamName).postData(GOOD_TEXT);
		sources.httpSource(streamName).postData(GOOD_BAD_TEXT);
		sources.httpSource(streamName).postData(BAD_TEXT);

		waitForMetric(afterGoodCounterName);
		waitForMetric(goodAndBadCounterName);

		assertEquals("The value expected for the  aftergood filter counter was 2", 2,
				getCount(afterGoodCounterName));

		assertEquals("The value expected for the goodandbad filter counter was 1", 1,
				getCount(goodAndBadCounterName));

	}
Verifies that we can capture multiple counts from the same stream.
spring-xd-integration-test/src/test/java/org/springframework/xd/integration/test/CountTests.java