@Test
public void testPresentFilter() {

	PresentFilter filter = new PresentFilter("foo");
	assertThat(filter.encode()).isEqualTo("(foo=*)");
	NotFilter notFilter = new NotFilter(new PresentFilter("foo"));
	assertThat(notFilter.encode()).isEqualTo("(!(foo=*))");
	AndFilter andFilter = new AndFilter();
	andFilter.and(new PresentFilter("foo"));
	andFilter.and(new PresentFilter("bar"));
	assertThat(andFilter.encode()).isEqualTo("(&(foo=*)(bar=*))");
	andFilter = new AndFilter();
	andFilter.and(new PresentFilter("foo"));
	andFilter.and(new NotFilter(new PresentFilter("bar")));
	assertThat(andFilter.encode()).isEqualTo("(&(foo=*)(!(bar=*)))");
}