### Question:
AttributeFilter implements SearchFilter { @Override public String getCssFilter() { String matcherAttribute = Optional.ofNullable(matcher).map(AbstractMatcher::getMatcherSymbol).orElse(""); return "[" + getAttribute() + matcherAttribute + "=\"" + matcher.getValue() + "\"]"; } AttributeFilter(String attributeName, String value);  AttributeFilter(String customAttribute, AbstractMatcher matcher); String getAttribute(); AbstractMatcher getMatcher(); @Override String toString(); @Override String getCssFilter(); @Override boolean isCssFilterSupported(); @Override Collection<FluentWebElement> applyFilter(Collection<FluentWebElement> elements);  }### Answer:
@Test public void shouldGetCSSFilterWithEmptyMatcherSymbol() { AbstractMatcher matcher = new EqualMatcher(A_VALUE); AttributeFilter attributeFilter = new AttributeFilter("id", matcher); String cssFilter = "[id=\"value\"]"; assertThat(attributeFilter.getCssFilter()).isEqualTo(cssFilter); }
@Test public void shouldGetCSSFilterWithNonEmptyMatcherSymbol() { AbstractMatcher matcher = new ContainsWordMatcher(A_VALUE); AttributeFilter attributeFilter = new AttributeFilter("id", matcher); String cssFilter = "[id~=\"value\"]"; assertThat(attributeFilter.getCssFilter()).isEqualTo(cssFilter); }
@Test public void shouldGetCSSFilterWithMatcherSymbolWithNullMatcherType() { AbstractMatcher matcher = new NoOpMatcher(A_VALUE); AttributeFilter attributeFilter = new AttributeFilter("id", matcher); String cssFilter = "[id=\"value\"]"; assertThat(attributeFilter.getCssFilter()).isEqualTo(cssFilter); }