AndFilter extends BinaryLogicalFilter { public AndFilter and(Filter query) { append(query); return this; }  AndFilter and(Filter query);  }
@Test public void testOne() { AndFilter aq = new AndFilter().and(new EqualsFilter("a", "b")); assertThat(aq.encode()).isEqualTo("(a=b)"); }
@Test public void testTwo() { AndFilter aq = new AndFilter().and(new EqualsFilter("a", "b")).and( new EqualsFilter("c", "d")); assertThat(aq.encode()).isEqualTo("(&(a=b)(c=d))"); }
@Test public void testThree() { AndFilter aq = new AndFilter().and(new EqualsFilter("a", "b")).and( new EqualsFilter("c", "d")).and(new EqualsFilter("e", "f")); assertThat(aq.encode()).isEqualTo("(&(a=b)(c=d)(e=f))"); }
@Test public void testEquals() { EqualsFilter filter = new EqualsFilter("a", "b"); AndFilter originalObject = new AndFilter().and(filter); AndFilter identicalObject = new AndFilter().and(filter); AndFilter differentObject = new AndFilter().and(new EqualsFilter("b", "b")); AndFilter subclassObject = new AndFilter() { }.and(filter); new EqualsTester(originalObject, identicalObject, differentObject, subclassObject); }