### Question:
DoubleSearch implements Iterable<DoubleDefinition> { public boolean containsAnyDoubleMatching(String beaName, Class<?> beanClass) { return 1 <= matchingDoublesCount(filterByName(beaName).or(filterByClass(beanClass))); } DoubleSearch(Collection<DoubleDefinition> doubles); boolean containsAnyDoubleMatching(String beaName, Class<?> beanClass); boolean containsExactlyOneDouble(String beanName, Class<?> beanClass); boolean containsExactlyOneDouble(String beanName); boolean containsExactlyOneDouble(Class<?> beanClass); DoubleDefinition findOneDefinition(String beanName, Class<?> beanClass); DoubleDefinition findOneDefinition(String beanName); DoubleDefinition findOneDefinition(Class<?> beanClass); @Override Iterator<DoubleDefinition> iterator(); @Override String toString();  }### Answer:
@Test public void should_match_by_name_or_class() { final String serviceMock = "mock"; final String otherServiceMock = "other mock"; final DoubleDefinition serviceDefinition = doubleDefinition(Service.class, serviceMock); final DoubleDefinition otherServiceDefinition = doubleDefinition(OtherService.class, otherServiceMock); final DoubleSearch search = new DoubleSearch(asList( serviceDefinition, otherServiceDefinition)); assertTrue(search.containsAnyDoubleMatching(serviceMock, Service.class)); assertTrue(search.containsAnyDoubleMatching(serviceMock, OtherService.class)); assertTrue(search.containsAnyDoubleMatching(otherServiceMock, OtherService.class)); assertTrue(search.containsAnyDoubleMatching(otherServiceMock, Service.class)); }