@Test
	public void testClean() throws Exception {
		MessageBus messageBus = getMessageBus();
		messageBus.bindProducer("foo.0", new DirectChannel(), null);
		messageBus.bindConsumer("foo.0", new DirectChannel(), null);
		messageBus.bindProducer("foo.1", new DirectChannel(), null);
		messageBus.bindConsumer("foo.1", new DirectChannel(), null);
		messageBus.bindProducer("foo.2", new DirectChannel(), null);
		Collection<?> bindings = getBindings(messageBus);
		assertEquals(5, bindings.size());
		messageBus.unbindProducers("foo.0");
		assertEquals(4, bindings.size());
		messageBus.unbindConsumers("foo.0");
		messageBus.unbindProducers("foo.1");
		assertEquals(2, bindings.size());
		messageBus.unbindConsumers("foo.1");
		messageBus.unbindProducers("foo.2");
		assertTrue(bindings.isEmpty());
	}
@author Gary Russell
@author Ilayaperumal Gopinathan
@author David Turanski
spring-xd-dirt/src/test/java/org/springframework/xd/dirt/integration/bus/AbstractMessageBusTests.java