@Test
	public void matchWithCountLessThanContainersMatchingCriteria() {
		deploymentProperties.setCount(1);
		deploymentProperties.setCriteria("group=='group2'");
		Collection<Container> matched = containerMatcher.match(moduleDescriptor, deploymentProperties,
				containers);
		assertEquals(1, matched.size());
		Iterator<Container> matchedIterator = matched.iterator();
		assertSame(containers.get(1), matchedIterator.next());

		matched = containerMatcher.match(moduleDescriptor, deploymentProperties,
				containers);
		assertEquals(1, matched.size());
		matchedIterator = matched.iterator();
		assertSame(containers.get(2), matchedIterator.next());

		matched = containerMatcher.match(moduleDescriptor, deploymentProperties,
				containers);
		assertEquals(1, matched.size());
		matchedIterator = matched.iterator();
		assertSame(containers.get(1), matchedIterator.next());
	}
Tests for {@link ContainerMatcher}

@author David Turanski
@author Ilayaperumal Gopinathan
spring-xd-dirt/src/test/java/org/springframework/xd/dirt/server/admin/deployment/DefaultContainerMatcherTests.java