@Test
public void testNestedNotnOrnAnd() throws Exception
{
String filter = "(&(|(postalCode=5)(postalCode=6))(!(ou=sales)))";
UuidSyntaxChecker uuidSynChecker = new UuidSyntaxChecker();
ExprNode exprNode = FilterParser.parse( schemaManager, filter );
optimizer.annotate( exprNode );
Cursor<Entry> cursor = buildCursor( exprNode );
Set<String> set = new HashSet<String>();
while ( cursor.next() )
{
assertTrue( cursor.available() );
Entry entry = cursor.get();
String uuid = entry.get( "entryUUID" ).getString();
set.add( uuid );
assertTrue( uuidSynChecker.isValidSyntax( uuid ) );
}
assertEquals( 2, set.size() );
assertTrue( set.contains( Strings.getUUID( 7L ) ) );
assertTrue( set.contains( Strings.getUUID( 8L ) ) );