ConstantPropertyValuePredicate implements Predicate<Component> { @Override public boolean apply(Component component) { return component.getPropertyValues().containsValue(propertyValue); } ConstantPropertyValuePredicate(Object value); @Override boolean apply(Component component);  }
@Test public void should_return_true_when_the_property_value_matches() throws Exception { ConstantPropertyValuePredicate predicate = new ConstantPropertyValuePredicate("bar"); assertThat(predicate.apply(aComponent() .withPropertyValue("foo", "constant", "bar") .build())).isTrue(); }
@Test public void should_return_false_when_property_value_do_not_match() throws Exception { ConstantPropertyValuePredicate predicate = new ConstantPropertyValuePredicate("qux"); assertThat(predicate.apply(aComponent() .withPropertyValue("foo", "constant", "bar") .build())).isFalse(); }
@Test public void should_return_false_when_property_value_is_not_a_constant() throws Exception { ConstantPropertyValuePredicate predicate = new ConstantPropertyValuePredicate("bar"); assertThat(predicate.apply(aComponent() .withPropertyValue("foo", "whatever", "bar") .build())).isFalse(); }