private boolean streamExists(String streamName) {
		PagedResources<StreamDefinitionResource> list = distributedTestSupport.ensureTemplate()
				.streamOperations().list();

		for (StreamDefinitionResource stream : list) {
			if (stream.getName().equals(streamName)) {
				return true;
			}
		}
		return false;
	}
Check if the stream exists.

@param streamName stream name
@return boolean true if the stream exists.
spring-xd-distributed-test/src/test/java/org/springframework/xd/distributed/test/AbstractDistributedTests.java