### Question:
AttributeFilterPredicate implements Predicate<FluentWebElement> { @Override public boolean test(FluentWebElement element) { String attribute = getAttributeValue(element); return filter.getMatcher().isSatisfiedBy(attribute); } AttributeFilterPredicate(AttributeFilter filter); @Override boolean test(FluentWebElement element);  }### Answer:
@Test public void textAttributeShouldSatisfyMatcher() { setupPredicateAndMatcher("text attribute value"); when(attributeFilter.getAttribute()).thenReturn("text"); when(fluentWebElement.text()).thenReturn("text attribute value"); assertThat(attributeFilterPredicate.test(fluentWebElement)).isTrue(); }
@Test public void textAttributeShouldNotSatisfyMatcher() { setupPredicateAndMatcher("text attribute value"); when(attributeFilter.getAttribute()).thenReturn("text"); when(fluentWebElement.text()).thenReturn("text attribute"); assertThat(attributeFilterPredicate.test(fluentWebElement)).isFalse(); }
@Test public void otherAttributeShouldSatisfyMatcher() { setupPredicateAndMatcher("not-text attribute value"); when(attributeFilter.getAttribute()).thenReturn("not-text"); when(fluentWebElement.attribute("not-text")).thenReturn("not-text attribute value"); assertThat(attributeFilterPredicate.test(fluentWebElement)).isTrue(); }
@Test public void otherAttributeShouldNotSatisfyMatcher() { setupPredicateAndMatcher("not-text attribute value"); when(attributeFilter.getAttribute()).thenReturn("not-text"); when(fluentWebElement.attribute("not-text")).thenReturn("not-text attribute"); assertThat(attributeFilterPredicate.test(fluentWebElement)).isFalse(); }